public final class ColorPalette extends Object implements IColorPalette
Defines an array of colors that make up a color palette. The colors are 32-bit ARGB colors. Not inheritable.
Constructor and Description |
---|
ColorPalette(Color[] entries)
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(int[] argb32Entries)
Initializes a new instance of the
ColorPalette class and IsCompactPalette is false. |
ColorPalette(int[] argb32Entries,
boolean isCompactPalette)
Initializes a new instance of the
ColorPalette class. |
Modifier and Type | Method and Description |
---|---|
static ColorPalette |
copyPalette(IColorPalette colorPalette)
Copies the palette.
|
static ColorPalette |
copyPalette(IColorPalette colorPalette,
boolean useCompactPalette)
Copies the palette.
|
int |
getArgb32Color(int index)
Gets the 32-bit ARGB palette color by index.
|
int[] |
getArgb32Entries()
Gets an array of 32-bit ARGB structures.
|
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.
|
int |
getNearestColorIndex(int argb32Color)
Gets the index of the nearest color.
|
boolean |
isCompactPalette()
Gets or sets a value indicating whether compact palette is used.
|
public ColorPalette(int[] argb32Entries, boolean isCompactPalette)
Initializes a new instance of the ColorPalette
class.
argb32Entries
- The 32-bit ARGB color palette entries.isCompactPalette
- Indicating whether compact it palette.public ColorPalette(int[] argb32Entries)
Initializes a new instance of the ColorPalette
class and IsCompactPalette is false.
argb32Entries
- The 32-bit ARGB color palette entries.public ColorPalette(Color[] entries, boolean isCompactPalette)
Initializes a new instance of the ColorPalette
class.
entries
- The color palette entries.isCompactPalette
- Indicating whether compact it palette.public ColorPalette(Color[] entries)
Initializes a new instance of the ColorPalette
class and IsCompactPalette is false.
entries
- The color palette entries.public final int getEntriesCount()
Gets the entries count.
Value: The entries count.getEntriesCount
in interface IColorPalette
public final int[] getArgb32Entries()
Gets an array of 32-bit ARGB structures.
getArgb32Entries
in interface IColorPalette
ColorPalette
.
Value: The entries.public final Color[] getEntries()
Gets an array of Color
structures.
getEntries
in interface IColorPalette
Color
structure that make up this ColorPalette
.
Value: The entries.public final boolean isCompactPalette()
Gets or sets a value indicating whether compact palette is used.
Value:true
if compact palette is used; otherwise, false
.isCompactPalette
in interface IColorPalette
public static ColorPalette copyPalette(IColorPalette colorPalette, boolean useCompactPalette)
Copies the palette.
colorPalette
- The color palette.useCompactPalette
- Indicating whether compact palette.public static ColorPalette copyPalette(IColorPalette colorPalette)
Copies the palette.
colorPalette
- The color palette.public final int getNearestColorIndex(int argb32Color)
Gets the index of the nearest color.
getNearestColorIndex
in interface IColorPalette
argb32Color
- The 32-bit ARGB color.public final int getNearestColorIndex(Color color)
Gets the index of the nearest color.
getNearestColorIndex
in interface IColorPalette
color
- The color.public final int getArgb32Color(int index)
Gets the 32-bit ARGB palette color by index.
getArgb32Color
in interface IColorPalette
index
- The 32-bit ARGB palette color index.index
.com.aspose.ms.System.ArgumentOutOfRangeException
- if color palette index
specified is out of the palette entries range.public final Color getColor(int index)
Gets the palette color by index.
getColor
in interface IColorPalette
index
- The palette color index.index
.com.aspose.ms.System.ArgumentOutOfRangeException
- if color palette index
specified is out of the palette entries range.Copyright (c) 2008-2019 Aspose Pty Ltd. All Rights Reserved.