ColorPalette

Inheritance: java.lang.Object

public final class ColorPalette

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

Constructors

ConstructorDescription
ColorPalette(int count)Initializes a new instance of the ColorPalette class and IsCompactPalette is false.

Methods

MethodDescription
getEntries()Gets an array of com.aspose.drawing.Color structures.
isCompactPalette()Gets or sets a value indicating whether compact palette is used.
getFlags()
setFlags(int flags)
setEntries(int i, Color color)

ColorPalette(int count)

public ColorPalette(int count)

Initializes a new instance of the ColorPalette class and IsCompactPalette is false.

Parameters:

ParameterTypeDescription
countintThe color palette entries.

getEntries()

public Color[] getEntries()

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

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

isCompactPalette()

public boolean isCompactPalette()

Gets or sets a value indicating whether compact palette is used.

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

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.

getFlags()

public int getFlags()

Returns: int

setFlags(int flags)

public void setFlags(int flags)

Parameters:

ParameterTypeDescription
flagsint

setEntries(int i, Color color)

public void setEntries(int i, Color color)

Parameters:

ParameterTypeDescription
iint
colorColor