PaletteBlackAndWhite(Color32, Byte) Method

Gets a Palette instance that uses the black and white colors.
See the Remarks section of the PredefinedColorsQuantizer.BlackAndWhite method for details and some examples.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.1.0
C#
public static Palette BlackAndWhite(
	Color32 backColor = default,
	byte whiteThreshold = 128
)

Parameters

backColor  Color32  (Optional)
Specifies the background color for lookup operations (GetNearestColor, GetNearestColorIndex). When a lookup is performed with a color with transparency, 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 Black.
whiteThreshold  Byte  (Optional)
Specifies a threshold value for the brightness of the colors, under which the result of a color lookup is considered black. If 0, then all colors are mapped to white. This parameter is optional.
Default value: 128.

Return Value

Palette
A Palette instance that uses the black and white colors.

See Also