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
| Name | Type | Access | 描述 |
|---|---|---|---|
| argb_32_entries | int[] | r | 获取 32 位 ARGB 结构的数组。 |
| entries | Color[] | r | 获取 Color 结构的数组。 |
| entries_count | int | r | 获取条目计数。 |
| is_compact_palette | bool | r | 获取或设置一个值,指示是否使用紧凑调色板。 |
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:
| 参数 | Type | Description |
|---|---|---|
| argb_32_entries | int[] | 32 位 ARGB 颜色调色板条目。 |
Constructor: ColorPalette(argb_32_entries, is_compact_palette)
ColorPalette(argb_32_entries, is_compact_palette)
初始化 ColorPalette 类的新实例。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| argb_32_entries | int[] | 32 位 ARGB 颜色调色板条目。 |
| is_compact_palette | bool | 指示调色板是否紧凑。 |
Constructor: ColorPalette(entries)
ColorPalette(entries)
初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| entries | Color[] |
Constructor: ColorPalette(entries, is_compact_palette)
ColorPalette(entries, is_compact_palette)
初始化 ColorPalette 类的新实例。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| entries | Color[] | |
| is_compact_palette | bool | 指示调色板是否紧凑。 |
Method: copy_palette(color_palette) [static]
copy_palette(color_palette)
复制调色板。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| color_palette | IColorPalette | 颜色调色板。 |
Returns
| Type | Description |
|---|---|
| ColorPalette | 如果传入空调色板,则返回新创建和复制的调色板,否则为 null。 |
Method: copy_palette(color_palette, use_compact_palette) [static]
copy_palette(color_palette, use_compact_palette)
复制调色板。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| color_palette | IColorPalette | 颜色调色板。 |
| use_compact_palette | bool | 指示调色板是否紧凑。 |
Returns
| Type | Description |
|---|---|
| ColorPalette | 如果传入空调色板,则返回新创建和复制的调色板,否则为 null。 |
Method: create_with_argb(argb_32_entries) [static]
create_with_argb(argb_32_entries)
初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| argb_32_entries | int[] | 32 位 ARGB 颜色调色板条目。 |
Returns
| Type | Description |
|---|---|
| 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:
| 参数 | Type | Description |
|---|---|---|
| argb_32_entries | int[] | 32 位 ARGB 颜色调色板条目。 |
| is_compact_palette | bool | 指示调色板是否紧凑。 |
Returns
| Type | Description |
|---|---|
| ColorPalette |
Method: create_with_colors(entries) [static]
create_with_colors(entries)
初始化 ColorPalette 类的新实例,并且 IsCompactPalette 为 false。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| entries | Color[] | 颜色调色板条目。 |
Returns
| Type | Description |
|---|---|
| ColorPalette |
Method: create_with_colors_compact(entries, is_compact_palette) [static]
create_with_colors_compact(entries, is_compact_palette)
初始化 ColorPalette 类的新实例。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| entries | Color[] | 颜色调色板条目。 |
| is_compact_palette | bool | 指示调色板是否紧凑。 |
Returns
| Type | Description |
|---|---|
| ColorPalette |
Method: get_argb_32_color(index)
get_argb_32_color(index)
按索引获取 32 位 ARGB 调色板颜色。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| index | int | 32 位 ARGB 调色板颜色索引。 |
Returns
| Type | Description |
|---|---|
| int | 由 index 指定的颜色调色板条目。 |
Method: get_color(index)
get_color(index)
按索引获取调色板颜色。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| index | int | 调色板颜色索引。 |
Returns
| Type | Description |
|---|---|
| Color | 由 index 指定的颜色调色板条目。 |
Method: get_nearest_argb_index(argb_32_color)
get_nearest_argb_index(argb_32_color)
获取最近颜色的索引。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| argb_32_color | int | 32 位 ARGB 颜色。 |
Returns
| Type | Description |
|---|---|
| int | 最近颜色的索引。 |
Method: get_nearest_color_index(argb_32_color)
get_nearest_color_index(argb_32_color)
获取最近颜色的索引。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| argb_32_color | int | 32 位 ARGB 颜色。 |
Returns
| Type | Description |
|---|---|
| int | 最近颜色的索引。 |
Method: get_nearest_color_index(color)
get_nearest_color_index(color)
获取最近颜色的索引。
Parameters:
| 参数 | Type | Description |
|---|---|---|
| color | Color |
Returns
| Type | Description |
|---|---|
| int | 最近颜色的索引。 |