PaletteSystemDefault1BppPalette(Color32, Byte) Method

Gets a Palette instance that uses the system default 1-bit palette. This palette consists of the black and white colors.
See the Remarks section of the PredefinedColorsQuantizer.SystemDefault1BppPalette method for details.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
C#
public static Palette SystemDefault1BppPalette(
	Color32 backColor = default,
	byte alphaThreshold = 128
)

Parameters

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.
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.

Return Value

Palette
A Palette instance that uses the system default 1-bit palette.

See Also