PsdColorPalette Class

Summary: The PSD color palette.

Module: aspose.psd.fileformats.psd

Full Name: aspose.psd.fileformats.psd.PsdColorPalette

Inheritance: IPsdColorPalette, IColorPalette

Aspose.PSD Version: 24.9.0

Constructors

NameDescription
PsdColorPalette(color_palette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(color_palette, transparent_index)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(color_palette_argb_32_entries, is_compact_palette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(color_palette_entries)Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
PsdColorPalette(color_palette_entries, is_compact_palette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(color_palette_entries, transparent_index)Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
PsdColorPalette(color_palette_entries, transparent_index, use_compact_palette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(raw_entries_data)Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
PsdColorPalette(raw_entries_data, is_compact_palette)Initializes a new instance of the PsdColorPalette class.
PsdColorPalette(raw_entries_data, transparent_index)Initializes a new instance of the PsdColorPalette class and IsCompactPalette is false.
PsdColorPalette(raw_entries_data, transparent_index, use_compact_palette)Initializes a new instance of the PsdColorPalette class.

Properties

NameTypeAccessDescription
argb_32_entriesintrGets an array of 32-bit ARGB colors.
entriesColor[]rGets an array of Color structures.
entries_countintrGets the entries count.
has_transparent_colorboolrGets a value indicating whether transparent color exists.
is_compact_paletteboolrGets a value indicating whether compact it palette.
raw_entriesbyterGets the raw color palette entries data.
raw_entries_countintrGets the raw color palette entries count.
transparent_colorColorrGets the transparent color.
transparent_indexshortrGets the index of the transparent color.

Methods

NameDescription
copy_palette(color_palette)Copies the palette.
copy_palette(color_palette, use_compact_palette)Copies the palette.
get_argb_32_color(index)Gets the 32-bit ARGB palette color by index.
get_color(index)Gets the palette color by index.
get_nearest_color_index(argb_32_color)Gets the index of the nearest color.
get_nearest_color_index(color)Gets the index of the nearest color.

Constructor: PsdColorPalette(color_palette)

 PsdColorPalette(color_palette) 

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
color_paletteIColorPaletteThe color palette.

Constructor: PsdColorPalette(color_palette, transparent_index)

 PsdColorPalette(color_palette, transparent_index) 

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
color_paletteIColorPaletteThe color palette.
transparent_indexshortThe transparent color index.

Constructor: PsdColorPalette(color_palette_argb_32_entries, is_compact_palette)

 PsdColorPalette(color_palette_argb_32_entries, is_compact_palette) 

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
color_palette_argb_32_entriesintThe color palette 32-bit ARGB entries.
is_compact_paletteboolIndicating whether compact it palette.

Constructor: PsdColorPalette(color_palette_entries)

 PsdColorPalette(color_palette_entries) 

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

Parameters:

ParameterTypeDescription
color_palette_entriesColor[]The color palette entries.

Constructor: PsdColorPalette(color_palette_entries, is_compact_palette)

 PsdColorPalette(color_palette_entries, is_compact_palette) 

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
color_palette_entriesColor[]The color palette entries.
is_compact_paletteboolIndicating whether compact it palette.

Constructor: PsdColorPalette(color_palette_entries, transparent_index)

 PsdColorPalette(color_palette_entries, transparent_index) 

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

Parameters:

ParameterTypeDescription
color_palette_entriesColor[]The color palette entries.
transparent_indexshortThe transparent color index.

Constructor: PsdColorPalette(color_palette_entries, transparent_index, use_compact_palette)

 PsdColorPalette(color_palette_entries, transparent_index, use_compact_palette) 

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
color_palette_entriesColor[]The color palette entries.
transparent_indexshortThe transparent color index.
use_compact_paletteboolIndicating whether compact it palette.

Constructor: PsdColorPalette(raw_entries_data)

 PsdColorPalette(raw_entries_data) 

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

Parameters:

ParameterTypeDescription
raw_entries_databyteThe raw entries data.

Constructor: PsdColorPalette(raw_entries_data, is_compact_palette)

 PsdColorPalette(raw_entries_data, is_compact_palette) 

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
raw_entries_databyteThe raw entries data.
is_compact_paletteboolIndicating whether compact it palette.

Constructor: PsdColorPalette(raw_entries_data, transparent_index)

 PsdColorPalette(raw_entries_data, transparent_index) 

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

Parameters:

ParameterTypeDescription
raw_entries_databyteThe raw entries data.
transparent_indexshortThe transparent color index. Note the index is not the raw entries index instead it is for the converted color array.

Constructor: PsdColorPalette(raw_entries_data, transparent_index, use_compact_palette)

 PsdColorPalette(raw_entries_data, transparent_index, use_compact_palette) 

Initializes a new instance of the PsdColorPalette class.

Parameters:

ParameterTypeDescription
raw_entries_databyteThe raw entries data.
transparent_indexshortThe transparent color index. Note the index is not the raw entries index instead it is for the converted color array.
use_compact_paletteboolIndicating whether compact it palette.

Method: copy_palette(color_palette) [static]

 copy_palette(color_palette) 

Copies the palette.

Parameters:

ParameterTypeDescription
color_paletteIColorPaletteThe color palette.

Returns

TypeDescription
PsdColorPaletteThe newly created and copied palette or null if null palette passed.

Method: copy_palette(color_palette, use_compact_palette) [static]

 copy_palette(color_palette, use_compact_palette) 

Copies the palette.

Parameters:

ParameterTypeDescription
color_paletteIColorPaletteThe color palette.
use_compact_paletteboolIndicating whether compact palette.

Returns

TypeDescription
PsdColorPaletteThe newly created and copied palette or null if null palette passed.

Method: get_argb_32_color(index)

 get_argb_32_color(index) 

Gets the 32-bit ARGB palette color by index.

Parameters:

ParameterTypeDescription
indexintThe 32-bit ARGB palette color index.

Returns

TypeDescription
intThe color palette entry specified by the .

Method: get_color(index)

 get_color(index) 

Gets the palette color by index.

Parameters:

ParameterTypeDescription
indexintThe palette color index.

Returns

TypeDescription
ColorThe color palette entry specified by the .

Method: get_nearest_color_index(argb_32_color)

 get_nearest_color_index(argb_32_color) 

Gets the index of the nearest color.

Parameters:

ParameterTypeDescription
argb_32_colorintThe 32-bit ARGB color.

Returns

TypeDescription
intThe index of the nearest color.

Method: get_nearest_color_index(color)

 get_nearest_color_index(color) 

Gets the index of the nearest color.

Parameters:

ParameterTypeDescription
colorColor

Returns

TypeDescription
intThe index of the nearest color.