IColorPalette

public interface IColorPalette

The color palette interface.

Methods

MethodDescription
getArgb32Color(int index)Gets the 32-bit ARGB palette color by index.
getArgb32Entries()Gets an array of 32-bit ARGB structures.
getColor(int index)Gets the palette color by index.
getEntries()Gets an array of com.aspose.psd.Color structures.
getEntriesCount()Gets the entries count.
getNearestColorIndex(Color color)Gets the index of the nearest color.
getNearestColorIndex(int argb32Color)Gets the index of the nearest 32-bit ARGB color.
isCompactPalette()Gets a value indicating whether compact palette is used.

getArgb32Color(int index)

public abstract int getArgb32Color(int index)

Gets the 32-bit ARGB palette color by index.

Parameters:

ParameterTypeDescription
indexintThe 32-bit ARGB palette color index.

Returns: int - The color palette entry specified by the index .

getArgb32Entries()

public abstract int[] getArgb32Entries()

Gets an array of 32-bit ARGB structures.

Returns: int[] - The 32-bit ARGB entries. The array of 32-bit ARGB structure that make up this com.aspose.psd.ColorPalette .

getColor(int index)

public abstract Color getColor(int index)

Gets the palette color by index.

Parameters:

ParameterTypeDescription
indexintThe palette color index.

Returns: Color - The color palette entry specified by the index .

getEntries()

public abstract Color[] getEntries()

Gets an array of com.aspose.psd.Color structures.

Returns: com.aspose.psd.Color[] - The entries. The array of com.aspose.psd.Color structure that make up this com.aspose.psd.ColorPalette .

getEntriesCount()

public abstract int getEntriesCount()

Gets the entries count.

Returns: int - The entries count.

getNearestColorIndex(Color color)

public abstract int getNearestColorIndex(Color color)

Gets the index of the nearest color.

Parameters:

ParameterTypeDescription
colorColorThe color.

Returns: int - The index of the nearest color.

getNearestColorIndex(int argb32Color)

public abstract int getNearestColorIndex(int argb32Color)

Gets the index of the nearest 32-bit ARGB color.

Parameters:

ParameterTypeDescription
argb32ColorintThe 32-bit ARGB color.

Returns: int - The index of the nearest color.

isCompactPalette()

public abstract boolean isCompactPalette()

Gets a value indicating whether compact palette is used.

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.

Returns: boolean - true if compact palette is used; otherwise, false .