public class PsdColorPalette extends Object implements IPsdColorPalette
The PSD color palette.
| Constructor and Description |
|---|
PsdColorPalette(byte[] rawEntriesData)
Initializes a new instance of the
PsdColorPalette class and IsCompactPalette is false. |
PsdColorPalette(byte[] rawEntriesData,
boolean isCompactPalette)
Initializes a new instance of the
PsdColorPalette class. |
PsdColorPalette(byte[] rawEntriesData,
short transparentIndex)
Initializes a new instance of the
PsdColorPalette class and IsCompactPalette is false. |
PsdColorPalette(byte[] rawEntriesData,
short transparentIndex,
boolean useCompactPalette)
Initializes a new instance of the
PsdColorPalette class. |
PsdColorPalette(Color[] colorPaletteEntries)
Initializes a new instance of the
PsdColorPalette class and IsCompactPalette is false. |
PsdColorPalette(Color[] colorPaletteEntries,
boolean isCompactPalette)
Initializes a new instance of the
PsdColorPalette class. |
PsdColorPalette(Color[] colorPaletteEntries,
short transparentIndex)
Initializes a new instance of the
PsdColorPalette class and IsCompactPalette is false. |
PsdColorPalette(Color[] colorPaletteEntries,
short transparentIndex,
boolean useCompactPalette)
Initializes a new instance of the
PsdColorPalette class. |
PsdColorPalette(IColorPalette colorPalette)
Initializes a new instance of the
PsdColorPalette class. |
PsdColorPalette(IColorPalette colorPalette,
short transparentIndex)
Initializes a new instance of the
PsdColorPalette class. |
PsdColorPalette(int[] colorPaletteArgb32Entries,
boolean isCompactPalette)
Initializes a new instance of the
PsdColorPalette class. |
| Modifier and Type | Method and Description |
|---|---|
static PsdColorPalette |
copyPalette(IColorPalette colorPalette)
Copies the palette.
|
static PsdColorPalette |
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 colors.
|
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.
|
byte[] |
getRawEntries()
Gets the raw color palette entries data.
|
int |
getRawEntriesCount()
Gets the raw color palette entries count.
|
Color |
getTransparentColor()
Gets the transparent color.
|
short |
getTransparentIndex()
Gets the index of the transparent color.
|
boolean |
hasTransparentColor()
Gets a value indicating whether transparent color exists.
|
boolean |
isCompactPalette()
Gets a value indicating whether compact it palette.
|
public PsdColorPalette(IColorPalette colorPalette)
Initializes a new instance of the PsdColorPalette class.
colorPalette - The color palette.public PsdColorPalette(IColorPalette colorPalette, short transparentIndex)
Initializes a new instance of the PsdColorPalette class.
colorPalette - The color palette.transparentIndex - The transparent color index.public PsdColorPalette(byte[] rawEntriesData,
boolean isCompactPalette)
Initializes a new instance of the PsdColorPalette class.
rawEntriesData - The raw entries data.isCompactPalette - Indicating whether compact it palette.public PsdColorPalette(byte[] rawEntriesData)
Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
rawEntriesData - The raw entries data.public PsdColorPalette(byte[] rawEntriesData,
short transparentIndex,
boolean useCompactPalette)
Initializes a new instance of the PsdColorPalette class.
rawEntriesData - The raw entries data.transparentIndex - The transparent color index. Note the index is not the raw entries index instead it is for the converted color array.useCompactPalette - Indicating whether compact it palette.public PsdColorPalette(byte[] rawEntriesData,
short transparentIndex)
Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
rawEntriesData - The raw entries data.transparentIndex - The transparent color index. Note the index is not the raw entries index instead it is for the converted color array.public PsdColorPalette(int[] colorPaletteArgb32Entries,
boolean isCompactPalette)
Initializes a new instance of the PsdColorPalette class.
colorPaletteArgb32Entries - The color palette 32-bit ARGB entries.isCompactPalette - Indicating whether compact it palette.public PsdColorPalette(Color[] colorPaletteEntries, boolean isCompactPalette)
Initializes a new instance of the PsdColorPalette class.
colorPaletteEntries - The color palette entries.isCompactPalette - Indicating whether compact it palette.public PsdColorPalette(Color[] colorPaletteEntries)
Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
colorPaletteEntries - The color palette entries.public PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex, boolean useCompactPalette)
Initializes a new instance of the PsdColorPalette class.
colorPaletteEntries - The color palette entries.transparentIndex - The transparent color index.useCompactPalette - Indicating whether compact it palette.public PsdColorPalette(Color[] colorPaletteEntries, short transparentIndex)
Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
colorPaletteEntries - The color palette entries.transparentIndex - The transparent color index.public final int getRawEntriesCount()
Gets the raw color palette entries count.
Value: The raw color palette entries count.getRawEntriesCount in interface IPsdColorPalettepublic final int getEntriesCount()
Gets the entries count.
Value: The entries count.getEntriesCount in interface IColorPalettepublic final int[] getArgb32Entries()
Gets an array of 32-bit ARGB colors.
getArgb32Entries in interface IColorPaletteColorPalette.
Value: The entries.public final Color[] getEntries()
Gets an array of Color structures.
getEntries in interface IColorPaletteColor structure that make up this ColorPalette.
Value: The entries.public final short getTransparentIndex()
Gets the index of the transparent color.
Value: The index of the transparent color.getTransparentIndex in interface IPsdColorPalettepublic final boolean hasTransparentColor()
Gets a value indicating whether transparent color exists.
Value:true if transparent color exists; otherwise, false.hasTransparentColor in interface IPsdColorPalettepublic final Color getTransparentColor()
Gets the transparent color.
Value: The transparent color.getTransparentColor in interface IPsdColorPalettepublic final byte[] getRawEntries()
Gets the raw color palette entries data.
Value: The raw color palette entries data.getRawEntries in interface IPsdColorPalettepublic final boolean isCompactPalette()
Gets a value indicating whether compact it palette.
Value:true if compact it palette; otherwise, false.isCompactPalette in interface IColorPalettetrue if compact palette is used; otherwise, false.public static PsdColorPalette copyPalette(IColorPalette colorPalette, boolean useCompactPalette)
Copies the palette.
colorPalette - The color palette.useCompactPalette - Indicating whether compact palette.public static PsdColorPalette 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 IColorPaletteargb32Color - The 32-bit ARGB color.public final int getNearestColorIndex(Color color)
Gets the index of the nearest color.
getNearestColorIndex in interface IColorPalettecolor - The color.public final int getArgb32Color(int index)
Gets the 32-bit ARGB palette color by index.
getArgb32Color in interface IColorPaletteindex - 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 IColorPaletteindex - 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-2020 Aspose Pty Ltd. All Rights Reserved.