PaletteRgb332(Color32, Boolean, Byte) Method
Gets a
Palette instance that uses an 8-bit palette where red, green and blue components are encoded in 3, 3 and 2 bits, respectively.
See the
Remarks section of the
PredefinedColorsQuantizer.Rgb332 method for details and some examples.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
public static Palette Rgb332(
Color32 backColor = default,
bool directMapping = false,
byte alphaThreshold = 128
)
Public Shared Function Rgb332 (
Optional backColor As Color32 = Nothing,
Optional directMapping As Boolean = false,
Optional alphaThreshold As Byte = 128
) As Palette
public:
static Palette^ Rgb332(
Color32 backColor = Color32(),
bool directMapping = false,
unsigned char alphaThreshold = 128
)
static member Rgb332 :
?backColor : Color32 *
?directMapping : bool *
?alphaThreshold : byte
(* Defaults:
let _backColor = defaultArg backColor new Color32()
let _directMapping = defaultArg directMapping false
let _alphaThreshold = defaultArg alphaThreshold 128
*)
-> Palette
- backColor Color32 (Optional)
- 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,
then the color to be found will be blended with this color before performing the lookup. The Color32.A field of the background color is ignored. This parameter is optional.
Default value: The default value of the Color32 type, which has the same RGB values as Color.Black. - directMapping Boolean (Optional)
- to map any color directly to an index instead of searching for the nearest color,
which is very fast but without dithering may end up in a noticeably poorer result and higher contrast;
to perform a lookup to determine nearest colors, which may be slower but more accurate. This parameter is optional.
Default value: . - alphaThreshold Byte (Optional)
- Specifies a threshold value for the Color32.A field, under which a quantized color
is considered completely transparent. Though the palette returned from this method does not contain alpha colors, it can be relevant in some cases, for example when drawing a partially
transparent bitmap onto a solid background with a quantizer using this palette. The source pixels, whose alpha value is below the alphaThreshold will be skipped,
whereas alpha pixels with higher opacity will be blended with the specified backColor. This parameter is optional.
Default value: 128.
PaletteA
Palette instance that uses an 8-bit palette where red, green and blue components are encoded in 3, 3 and 2 bits, respectively.