ColorPalette

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.psd.IColorPalette

public final class ColorPalette implements IColorPalette

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

Constructors

ConstructorDescription
ColorPalette(int[] argb32Entries, boolean isCompactPalette)Initializes a new instance of the ColorPalette class.
ColorPalette(int[] argb32Entries)Initializes a new instance of the ColorPalette class and IsCompactPalette is false.
ColorPalette(Color[] entries, boolean isCompactPalette)Initializes a new instance of the ColorPalette class.
ColorPalette(Color[] entries)Initializes a new instance of the ColorPalette class and IsCompactPalette is false.

Methods

MethodDescription
copyPalette(IColorPalette colorPalette)Copies the palette.
copyPalette(IColorPalette colorPalette, boolean useCompactPalette)Copies the palette.
equals(Object arg0)
getArgb32Color(int index)Gets the 32-bit ARGB palette color by index.
getArgb32Entries()Gets an array of 32-bit ARGB structures.
getClass()
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 color.
hashCode()
isCompactPalette()Gets or sets a value indicating whether compact palette is used.
notify()
notifyAll()
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

ColorPalette(int[] argb32Entries, boolean isCompactPalette)

public ColorPalette(int[] argb32Entries, boolean isCompactPalette)

Initializes a new instance of the ColorPalette class.

Parameters:

ParameterTypeDescription
argb32Entriesint[]The 32-bit ARGB color palette entries.
isCompactPalettebooleanIndicating whether compact it palette.

ColorPalette(int[] argb32Entries)

public ColorPalette(int[] argb32Entries)

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

Parameters:

ParameterTypeDescription
argb32Entriesint[]The 32-bit ARGB color palette entries.

ColorPalette(Color[] entries, boolean isCompactPalette)

public ColorPalette(Color[] entries, boolean isCompactPalette)

Initializes a new instance of the ColorPalette class.

Parameters:

ParameterTypeDescription
entriesColor[]The color palette entries.
isCompactPalettebooleanIndicating whether compact it palette.

ColorPalette(Color[] entries)

public ColorPalette(Color[] entries)

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

Parameters:

ParameterTypeDescription
entriesColor[]The color palette entries.

copyPalette(IColorPalette colorPalette)

public static ColorPalette copyPalette(IColorPalette colorPalette)

Copies the palette.

Parameters:

ParameterTypeDescription
colorPaletteIColorPaletteThe color palette.

Returns: ColorPalette - The newly created and copied palette or null if null palette passed.

copyPalette(IColorPalette colorPalette, boolean useCompactPalette)

public static ColorPalette copyPalette(IColorPalette colorPalette, boolean useCompactPalette)

Copies the palette.

Parameters:

ParameterTypeDescription
colorPaletteIColorPaletteThe color palette.
useCompactPalettebooleanIndicating whether compact palette.

Returns: ColorPalette - The newly created and copied palette or null if null palette passed.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getArgb32Color(int index)

public 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 int[] getArgb32Entries()

Gets an array of 32-bit ARGB structures.

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

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColor(int index)

public 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 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 Aspose.Imaging.ColorPalette .

getEntriesCount()

public int getEntriesCount()

Gets the entries count.

Returns: int - The entries count.

getNearestColorIndex(Color color)

public 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 int getNearestColorIndex(int argb32Color)

Gets the index of the nearest color.

Parameters:

ParameterTypeDescription
argb32ColorintThe 32-bit ARGB color.

Returns: int - The index of the nearest color.

hashCode()

public native int hashCode()

Returns: int

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.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int