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.imaging

Full Name: aspose.imaging.ColorPalette

Inheritance: IColorPalette

Constructors

NameDescription
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

NameTypeAccessDescription
argb_32_entriesintrGets an array of 32-bit ARGB structures.
entriesColor[]rGets an array of Color structures.
entries_countintrGets the entries count.
is_compact_paletteboolrGets or sets a value indicating whether compact palette is used.

Methods

NameDescription
copy_palette(color_palette)Copies the palette.
copy_palette(color_palette, use_compact_palette)Copies the palette.
create_with_argb(argb_32_entries)Initializes a new instance of the ColorPalette class and IsCompactPalette is false.
create_with_argb_compact(argb_32_entries, is_compact_palette)Initializes a new instance of the ColorPalette class.
create_with_colors(entries)Initializes a new instance of the ColorPalette class and IsCompactPalette is false.
create_with_colors_compact(entries, is_compact_palette)Initializes a new instance of the ColorPalette class.
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_argb_index(argb_32_color)Gets the index of the nearest color.
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:

ParameterTypeDescription
argb_32_entriesintThe 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:

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

Constructor: ColorPalette(entries)

 ColorPalette(entries) 

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

Parameters:

ParameterTypeDescription
entriesColor[]

Constructor: ColorPalette(entries, is_compact_palette)

 ColorPalette(entries, is_compact_palette) 

Initializes a new instance of the ColorPalette class.

Parameters:

ParameterTypeDescription
entriesColor[]
is_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
ColorPaletteThe 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
ColorPaletteThe newly created and copied palette or null if null palette passed.

Method: create_with_argb(argb_32_entries) [static]

 create_with_argb(argb_32_entries) 

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

Parameters:

ParameterTypeDescription
argb_32_entriesintThe 32-bit ARGB color palette entries.

Returns

TypeDescription
ColorPalette

Method: create_with_argb_compact(argb_32_entries, is_compact_palette) [static]

 create_with_argb_compact(argb_32_entries, is_compact_palette) 

Initializes a new instance of the ColorPalette class.

Parameters:

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

Returns

TypeDescription
ColorPalette

Method: create_with_colors(entries) [static]

 create_with_colors(entries) 

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

Parameters:

ParameterTypeDescription
entriesColor[]The color palette entries.

Returns

TypeDescription
ColorPalette

Method: create_with_colors_compact(entries, is_compact_palette) [static]

 create_with_colors_compact(entries, is_compact_palette) 

Initializes a new instance of the ColorPalette class.

Parameters:

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

Returns

TypeDescription
ColorPalette

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 index.

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 index.

Method: get_nearest_argb_index(argb_32_color)

 get_nearest_argb_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(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.