Class ColorPalette

ColorPalette class

Defines an array of colors that make up a color palette. The colors are 32-bit ARGB colors. Not inheritable.

public sealed class ColorPalette : IColorPalette

Constructors

NameDescription
ColorPalette(Color[])Initializes a new instance of the ColorPalette class and IsCompactPalette is false.
ColorPalette(int[])Initializes a new instance of the ColorPalette class and IsCompactPalette is false.
ColorPalette(Color[], bool)Initializes a new instance of the ColorPalette class.
ColorPalette(int[], bool)Initializes a new instance of the ColorPalette class.

Properties

NameDescription
Argb32Entries { get; }Gets an array of 32-bit ARGB structures.
Entries { get; }Gets an array of Color structures.
EntriesCount { get; }Gets the entries count.
IsCompactPalette { get; }Gets or sets a value indicating whether compact palette is used.

Methods

NameDescription
static CopyPalette(IColorPalette)Copies the palette.
static CopyPalette(IColorPalette, bool)Copies the palette.
GetArgb32Color(int)Gets the 32-bit ARGB palette color by index.
GetColor(int)Gets the palette color by index.
GetNearestColorIndex(Color)Gets the index of the nearest color.
GetNearestColorIndex(int)Gets the index of the nearest color.

See Also