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.12.0
Constructors
Properties
| Name | Type | Access | Description |
|---|---|---|---|
| argb_32_entries | int | r | Gets an array of 32-bit ARGB colors. |
| entries | Color[] | r | Gets an array of Color structures. |
| entries_count | int | r | Gets the entries count. |
| has_transparent_color | bool | r | Gets a value indicating whether transparent color exists. |
| is_compact_palette | bool | r | Gets a value indicating whether compact it palette. |
| raw_entries | byte | r | Gets the raw color palette entries data. |
| raw_entries_count | int | r | Gets the raw color palette entries count. |
| transparent_color | Color | r | Gets the transparent color. |
| transparent_index | short | r | Gets the index of the transparent color. |
Methods
| Name | Description |
|---|---|
| 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:
| Parameter | Type | Description |
|---|---|---|
| color_palette | IColorPalette | The color palette. |
Constructor: PsdColorPalette(color_palette, transparent_index)
PsdColorPalette(color_palette, transparent_index)
Initializes a new instance of the PsdColorPalette class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| color_palette | IColorPalette | The color palette. |
| transparent_index | short | The 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:
| Parameter | Type | Description |
|---|---|---|
| color_palette_argb_32_entries | int | The color palette 32-bit ARGB entries. |
| is_compact_palette | bool | Indicating 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:
| Parameter | Type | Description |
|---|---|---|
| color_palette_entries | Color[] | 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:
| Parameter | Type | Description |
|---|---|---|
| color_palette_entries | Color[] | The color palette entries. |
| is_compact_palette | bool | Indicating 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:
| Parameter | Type | Description |
|---|---|---|
| color_palette_entries | Color[] | The color palette entries. |
| transparent_index | short | The 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:
| Parameter | Type | Description |
|---|---|---|
| color_palette_entries | Color[] | The color palette entries. |
| transparent_index | short | The transparent color index. |
| use_compact_palette | bool | Indicating 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:
| Parameter | Type | Description |
|---|---|---|
| raw_entries_data | byte | The 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:
| Parameter | Type | Description |
|---|---|---|
| raw_entries_data | byte | The raw entries data. |
| is_compact_palette | bool | Indicating 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:
| Parameter | Type | Description |
|---|---|---|
| raw_entries_data | byte | The raw entries data. |
| transparent_index | short | The 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:
| Parameter | Type | Description |
|---|---|---|
| raw_entries_data | byte | The raw entries data. |
| transparent_index | short | The transparent color index. Note the index is not the raw entries index instead it is for the converted color array. |
| use_compact_palette | bool | Indicating whether compact it palette. |
Method: copy_palette(color_palette) [static]
copy_palette(color_palette)
Copies the palette.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| color_palette | IColorPalette | The color palette. |
Returns
| Type | Description |
|---|---|
| PsdColorPalette | The 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:
| Parameter | Type | Description |
|---|---|---|
| color_palette | IColorPalette | The color palette. |
| use_compact_palette | bool | Indicating whether compact palette. |
Returns
| Type | Description |
|---|---|
| PsdColorPalette | The 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:
| Parameter | Type | Description |
|---|---|---|
| index | int | The 32-bit ARGB palette color index. |
Returns
| Type | Description |
|---|---|
| int | The color palette entry specified by the |
Method: get_color(index)
get_color(index)
Gets the palette color by index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | The palette color index. |
Returns
| Type | Description |
|---|---|
| Color | The 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:
| Parameter | Type | Description |
|---|---|---|
| argb_32_color | int | The 32-bit ARGB color. |
Returns
| Type | Description |
|---|---|
| int | The index of the nearest color. |
Method: get_nearest_color_index(color)
get_nearest_color_index(color)
Gets the index of the nearest color.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| color | Color |
Returns
| Type | Description |
|---|---|
| int | The index of the nearest color. |