Note
For examples see the Examples section of the FromCustomPalette(Palette) overload.
public static PredefinedColorsQuantizer FromCustomPalette(
IEnumerable<Color32> palette,
Color32 backColor = default,
byte alphaThreshold = 128
)Public Shared Function FromCustomPalette (
palette As IEnumerable(Of Color32),
Optional backColor As Color32 = Nothing,
Optional alphaThreshold As Byte = 128
) As PredefinedColorsQuantizerpublic:
static PredefinedColorsQuantizer^ FromCustomPalette(
IEnumerable<Color32>^ palette,
Color32 backColor = Color32(),
unsigned char alphaThreshold = 128
)static member FromCustomPalette :
palette : IEnumerable<Color32> *
?backColor : Color32 *
?alphaThreshold : byte
(* Defaults:
let _backColor = defaultArg backColor new Color32()
let _alphaThreshold = defaultArg alphaThreshold 128
*)
-> PredefinedColorsQuantizer The PredefinedColorsQuantizer instance returned by this method will use a Palette internally, created from the colors specified in the palette parameter. When quantizing, best matching colors might be looked up sequentially and results might be cached.
If a color to be quantized can be mapped to a color index directly, then create a Palette instance explicitly, specifying the custom mapping logic and use the FromCustomPalette(Palette) overload instead.
If a color to be quantized can be transformed to a result color directly, and the quantized result is not needed to be an indexed image, then use the FromCustomFunction overloads instead.