com.aspose.imaging
Class ColorPalette

java.lang.Object
  extended by com.aspose.imaging.ColorPalette
All Implemented Interfaces:
IColorPalette

public final class ColorPalette
extends java.lang.Object
implements IColorPalette

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


Constructor Summary
ColorPalette(Color[] entries)
           Initializes a new instance of the ColorPalette class.
 
Method Summary
 Color getColor(int index)
           Gets the palette color by index.
 Color[] getEntries()
           Gets an array of Color structures.
 int getEntriesCount()
           Gets the entries count.
 int getNearestColorIndex(Color color)
           Gets the index of the nearest color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorPalette

public ColorPalette(Color[] entries)

Initializes a new instance of the ColorPalette class.

Parameters:
entries - The color palette entries.
Method Detail

getColor

public Color getColor(int index)

Gets the palette color by index.

Specified by:
getColor in interface IColorPalette
Parameters:
index - The palette color index.
Returns:
The color palette entry specified by the index.
Throws:
java.lang.IllegalArgumentException - if color palette index specified is out of the palette entries range.

getEntries

public Color[] getEntries()

Gets an array of Color structures.

Specified by:
getEntries in interface IColorPalette
Returns:
The array of Color structure that make up this ColorPalette. Value: The entries.

getEntriesCount

public int getEntriesCount()

Gets the entries count.

Value: The entries count.

Specified by:
getEntriesCount in interface IColorPalette

getNearestColorIndex

public int getNearestColorIndex(Color color)

Gets the index of the nearest color.

Specified by:
getNearestColorIndex in interface IColorPalette
Parameters:
color - The color.
Returns:
The index of the nearest color.