ColorPalette 类

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

Name描述
ColorPalette(argb_32_entries)初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。
ColorPalette(argb_32_entries, is_compact_palette)初始化 ColorPalette 类的新实例。
ColorPalette(entries)初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。
ColorPalette(entries, is_compact_palette)初始化 ColorPalette 类的新实例。

Properties

NameTypeAccess描述
argb_32_entriesint[]r获取 32 位 ARGB 结构的数组。
entriesColor[]r获取 Color 结构的数组。
entries_countintr获取条目计数。
is_compact_paletteboolr获取或设置一个值,指示是否使用紧凑调色板。

Methods

Name描述
copy_palette(color_palette)复制调色板。
copy_palette(color_palette, use_compact_palette)复制调色板。
create_with_argb(argb_32_entries)初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。
create_with_argb_compact(argb_32_entries, is_compact_palette)初始化 ColorPalette 类的新实例。
create_with_colors(entries)初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。
create_with_colors_compact(entries, is_compact_palette)初始化 ColorPalette 类的新实例。
get_argb_32_color(index)按索引获取 32 位 ARGB 调色板颜色。
get_color(index)按索引获取调色板颜色。
get_nearest_argb_index(argb_32_color)获取最近颜色的索引。
get_nearest_color_index(argb_32_color)获取最近颜色的索引。
get_nearest_color_index(color)获取最近颜色的索引。

Constructor: ColorPalette(argb_32_entries)

 ColorPalette(argb_32_entries) 

初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。

Parameters:

参数TypeDescription
argb_32_entriesint[]32 位 ARGB 颜色调色板条目。

Constructor: ColorPalette(argb_32_entries, is_compact_palette)

 ColorPalette(argb_32_entries, is_compact_palette) 

初始化 ColorPalette 类的新实例。

Parameters:

参数TypeDescription
argb_32_entriesint[]32 位 ARGB 颜色调色板条目。
is_compact_palettebool指示调色板是否紧凑。

Constructor: ColorPalette(entries)

 ColorPalette(entries) 

初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。

Parameters:

参数TypeDescription
entriesColor[]

Constructor: ColorPalette(entries, is_compact_palette)

 ColorPalette(entries, is_compact_palette) 

初始化 ColorPalette 类的新实例。

Parameters:

参数TypeDescription
entriesColor[]
is_compact_palettebool指示调色板是否紧凑。

Method: copy_palette(color_palette) [static]

 copy_palette(color_palette) 

复制调色板。

Parameters:

参数TypeDescription
color_paletteIColorPalette颜色调色板。

Returns

TypeDescription
ColorPalette如果传入空调色板,则返回新创建和复制的调色板,否则为 null。

Method: copy_palette(color_palette, use_compact_palette) [static]

 copy_palette(color_palette, use_compact_palette) 

复制调色板。

Parameters:

参数TypeDescription
color_paletteIColorPalette颜色调色板。
use_compact_palettebool指示调色板是否紧凑。

Returns

TypeDescription
ColorPalette如果传入空调色板,则返回新创建和复制的调色板,否则为 null。

Method: create_with_argb(argb_32_entries) [static]

 create_with_argb(argb_32_entries) 

初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。

Parameters:

参数TypeDescription
argb_32_entriesint[]32 位 ARGB 颜色调色板条目。

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) 

初始化 ColorPalette 类的新实例。

Parameters:

参数TypeDescription
argb_32_entriesint[]32 位 ARGB 颜色调色板条目。
is_compact_palettebool指示调色板是否紧凑。

Returns

TypeDescription
ColorPalette

Method: create_with_colors(entries) [static]

 create_with_colors(entries) 

初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。

Parameters:

参数TypeDescription
entriesColor[]颜色调色板条目。

Returns

TypeDescription
ColorPalette

Method: create_with_colors_compact(entries, is_compact_palette) [static]

 create_with_colors_compact(entries, is_compact_palette) 

初始化 ColorPalette 类的新实例。

Parameters:

参数TypeDescription
entriesColor[]颜色调色板条目。
is_compact_palettebool指示调色板是否紧凑。

Returns

TypeDescription
ColorPalette

Method: get_argb_32_color(index)

 get_argb_32_color(index) 

按索引获取 32 位 ARGB 调色板颜色。

Parameters:

参数TypeDescription
indexint32 位 ARGB 调色板颜色索引。

Returns

TypeDescription
intindex 指定的颜色调色板条目。

Method: get_color(index)

 get_color(index) 

按索引获取调色板颜色。

Parameters:

参数TypeDescription
indexint调色板颜色索引。

Returns

TypeDescription
Colorindex 指定的颜色调色板条目。

Method: get_nearest_argb_index(argb_32_color)

 get_nearest_argb_index(argb_32_color) 

获取最近颜色的索引。

Parameters:

参数TypeDescription
argb_32_colorint32 位 ARGB 颜色。

Returns

TypeDescription
int最近颜色的索引。

Method: get_nearest_color_index(argb_32_color)

 get_nearest_color_index(argb_32_color) 

获取最近颜色的索引。

Parameters:

参数TypeDescription
argb_32_colorint32 位 ARGB 颜色。

Returns

TypeDescription
int最近颜色的索引。

Method: get_nearest_color_index(color)

 get_nearest_color_index(color) 

获取最近颜色的索引。

Parameters:

参数TypeDescription
colorColor

Returns

TypeDescription
int最近颜色的索引。