# IColorPalette

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-color-picker/trait-icolorpalette/

**trait** · [`ferroui-controls-color-picker`](/docs/0.5.0/api/ferroui-controls-color-picker/) · v0.5.0

```rust
trait IColorPalette
```

Interface to define a color palette.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_palettes/i_color_palette.rs#L4)

## Members

- [`color_count`](#function-color_count)
- [`shade_count`](#function-shade_count)
- [`get_color`](#function-get_color)

<a id="function-color_count"></a>

### color_count

```rust
fn color_count(self: &Self) -> i32
```

Gets the total number of colors in this palette.
A color is not necessarily a single value and may be composed of several shades.

Represents total columns in a table.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_palettes/i_color_palette.rs#L9)

<a id="function-shade_count"></a>

### shade_count

```rust
fn shade_count(self: &Self) -> i32
```

Gets the total number of shades for each color in this palette.
Shades are usually a variation of the color lightening or darkening it.

Represents total rows in a table.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_palettes/i_color_palette.rs#L15)

<a id="function-get_color"></a>

### get_color

```rust
fn get_color(self: &Self, color_index: i32, shade_index: i32) -> Color
```

Gets a color in the palette by index.

`color_index` is the index of the color in the palette; the index must
be between zero and `color_count`.
`shade_index` is the index of the color shade in the palette; the
index must be between zero and `shade_count`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_palettes/i_color_palette.rs#L23)

## Trait implementations

- [`IColorPalette`](/docs/0.5.0/api/ferroui-controls-color-picker/trait-icolorpalette/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
