ColorPalette Class
Summary: Defines an array of colors that make up a color palette. The colors are 32-bit ARGB colors. Not inheritable.
Module: aspose.psd
Full Name: aspose.psd.ColorPalette
Inheritance: IColorPalette
Aspose.PSD Version: 24.9.0
Constructors
Name | Description |
---|---|
ColorPalette(argb_32_entries) | Initializes a new instance of the ColorPalette class and IsCompactPalette is false. |
ColorPalette(argb_32_entries, is_compact_palette) | Initializes a new instance of the ColorPalette class. |
ColorPalette(entries) | Initializes a new instance of the ColorPalette class and IsCompactPalette is false. |
ColorPalette(entries, is_compact_palette) | Initializes a new instance of the ColorPalette class. |
Properties
Name | Type | Access | Description |
---|---|---|---|
argb_32_entries | int | r | Gets an array of 32-bit ARGB structures. |
entries | Color[] | r | Gets an array of Color structures. |
entries_count | int | r | Gets the entries count. |
is_compact_palette | bool | r | Gets or sets a value indicating whether compact palette is used. |
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: ColorPalette(argb_32_entries)
ColorPalette(argb_32_entries)
Initializes a new instance of the ColorPalette class and IsCompactPalette is false.
Parameters:
Parameter | Type | Description |
---|---|---|
argb_32_entries | int | The 32-bit ARGB color palette entries. |
Constructor: ColorPalette(argb_32_entries, is_compact_palette)
ColorPalette(argb_32_entries, is_compact_palette)
Initializes a new instance of the ColorPalette class.
Parameters:
Parameter | Type | Description |
---|---|---|
argb_32_entries | int | The 32-bit ARGB color palette entries. |
is_compact_palette | bool | Indicating whether compact it palette. |
Constructor: ColorPalette(entries)
ColorPalette(entries)
Initializes a new instance of the ColorPalette class and IsCompactPalette is false.
Parameters:
Parameter | Type | Description |
---|---|---|
entries | Color[] |
Constructor: ColorPalette(entries, is_compact_palette)
ColorPalette(entries, is_compact_palette)
Initializes a new instance of the ColorPalette class.
Parameters:
Parameter | Type | Description |
---|---|---|
entries | Color[] | |
is_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 |
---|---|
ColorPalette | 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 |
---|---|
ColorPalette | 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. |