Palette(Color, Color, Byte, FuncColor32, Int32) Constructor
Note: This API is now obsolete.
Initializes a new instance of the
Palette class.
See the
Remarks section of the
Palette class for details.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
[ObsoleteAttribute("This constructor overload is obsolete. Use the overload with (IEnumerable<Color32>, Color32, byte, Func<Color32, IPalette, int>?) parameters instead.")]
public Palette(
Color[] entries,
Color backColor,
byte alphaThreshold,
Func<Color32, int>? customGetNearestColorIndex
)
<ObsoleteAttribute("This constructor overload is obsolete. Use the overload with (IEnumerable<Color32>, Color32, byte, Func<Color32, IPalette, int>?) parameters instead.")>
Public Sub New (
entries As Color(),
backColor As Color,
alphaThreshold As Byte,
customGetNearestColorIndex As Func(Of Color32, Integer)
)
public:
[ObsoleteAttribute(L"This constructor overload is obsolete. Use the overload with (IEnumerable<Color32>, Color32, byte, Func<Color32, IPalette, int>?) parameters instead.")]
Palette(
array<Color>^ entries,
Color backColor,
unsigned char alphaThreshold,
Func<Color32, int>^ customGetNearestColorIndex
)
[<ObsoleteAttribute("This constructor overload is obsolete. Use the overload with (IEnumerable<Color32>, Color32, byte, Func<Color32, IPalette, int>?) parameters instead.")>]
new :
entries : Color[] *
backColor : Color *
alphaThreshold : byte *
customGetNearestColorIndex : Func<Color32, int> -> Palette
Parameters
- entries Color
- The color entries to be stored by this Palette instance. They will be converted to Color32 instances internally.
- backColor Color
- If entries does not contain partially transparent colors, then specifies the background color for
lookup operations (GetNearestColor, GetNearestColorIndex).
When a lookup is performed with a color, whose Color32.A field is equal to or greater than alphaThreshold, and there is no exact match among the entries,
then the color to be found will be blended with this color before performing the lookup. The Color.A property of the background color is ignored.
- alphaThreshold Byte
- If there is at least one completely transparent color among entries,
then specifies a threshold value for the Color32.A field, under which lookup operations will return the first transparent color (GetNearestColor)
or the index of the first transparent color (GetNearestColorIndex).
- customGetNearestColorIndex FuncColor32, Int32
- A delegate specifying an optional custom lookup logic to obtain an index from entries by a Color32 instance.
If specified, it must be thread-safe, and it is expected to be fast. The results returned by the specified delegate are not cached. If ,
then GetNearestColor and GetNearestColorIndex methods will perform a sequential lookup by using a default logic and results will be cached.