Interface IColorPalette
Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.2.0)
The color palette interface.
public interface IColorPalette
Properties
Argb32Entries
Gets an array of 32-bit ARGB structures.
int[] Argb32Entries { get; }
Property Value
int[]
Entries
Gets an array of Aspose.Imaging.Color structures.
Color[] Entries { get; }
Property Value
Color[]
EntriesCount
Gets the entries count.
int EntriesCount { get; }
Property Value
IsCompactPalette
Gets a value indicating whether compact palette is used.
bool IsCompactPalette { get; }
Property Value
Remarks
Compact palette means that image will contain only the specified palette entries if possible or in other words the image will be more compact and occupy less space; otherwise there will be 2^BitsPerPixel entries and image will reserve more space for all possible palette entries. Setting this value to true and changing palette entries may cause performance penalty since data movement may occur so use it carefully.
Methods
GetArgb32Color(int)
Gets the 32-bit ARGB palette color by index.
int GetArgb32Color(int index)
Parameters
index
int
The 32-bit ARGB palette color index.
Returns
The color palette entry specified by the index
.
Exceptions
if color palette index
specified is out of the palette entries range.
GetColor(int)
Gets the palette color by index.
Color GetColor(int index)
Parameters
index
int
The palette color index.
Returns
The color palette entry specified by the index
.
Exceptions
if color palette index
specified is out of the palette entries range.
GetNearestColorIndex(int)
Gets the index of the nearest 32-bit ARGB color.
int GetNearestColorIndex(int argb32Color)
Parameters
argb32Color
int
The 32-bit ARGB color.
Returns
The index of the nearest color.
GetNearestColorIndex(Color)
Gets the index of the nearest color.
int GetNearestColorIndex(Color color)
Parameters
color
Color
The color.
Returns
The index of the nearest color.