# AccentColorConverter

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-color-picker/primitives/converters/struct-accentcolorconverter/

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

```rust
struct AccentColorConverter
```

Creates an accent color for a given base color value and step parameter.

This is a highly-specialized converter for the color picker.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/converters/accent_color_converter.rs#L15)

## Members

- [`VALUE_DELTA`](#assoc_const-value_delta)
- [`new`](#function-new)
- [`get_accent`](#function-get_accent)

<a id="assoc_const-value_delta"></a>

### VALUE_DELTA

```rust
const VALUE_DELTA: f64
```

The amount to change the Value component for each accent color step.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/converters/accent_color_converter.rs#L19)

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

### new

```rust
fn new() -> Self
```

Initializes a new instance of the `AccentColorConverter` class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/converters/accent_color_converter.rs#L22)

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

### get_accent

```rust
fn get_accent(hsv_color: HsvColor, accent_step: i32) -> HsvColor
```

This does not account for perceptual differences and also does not match with
system accent color calculation.

Use the HSV representation as it's more perceptual.
In most cases only the value is changed by a fixed percentage so the algorithm is reproducible.

`hsv_color` is the base color to calculate the accent from; `accent_step`
is the number of accent color steps to move (positive or negative).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/converters/accent_color_converter.rs#L34)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Debug`
- `Default`
- [`IValueConverter`](/docs/0.5.0/api/ferroui-base/data/converters/trait-ivalueconverter/)
- `PartialEq`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)

## Availability

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