# PlatformColorValues

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/platform/struct-platformcolorvalues/

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

```rust
struct PlatformColorValues
```

Information about current system color values, including information
about dark mode and accent colors.

It is a value: build one from `PlatformColorValues::new` with the
`with_*` methods.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L49)

## Members

- [`new`](#function-new)
- [`theme_variant`](#function-theme_variant)
- [`with_theme_variant`](#function-with_theme_variant)
- [`contrast_preference`](#function-contrast_preference)
- [`with_contrast_preference`](#function-with_contrast_preference)
- [`accent_color1`](#function-accent_color1)
- [`with_accent_color1`](#function-with_accent_color1)
- [`accent_color2`](#function-accent_color2)
- [`with_accent_color2`](#function-with_accent_color2)
- [`accent_color3`](#function-accent_color3)
- [`with_accent_color3`](#function-with_accent_color3)
- [`accent_shades`](#function-accent_shades)
- [`with_accent_shades`](#function-with_accent_shades)

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

### new

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

Creates the default color values: the light theme, no contrast
preference and the default accent color.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L64)

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

### theme_variant

```rust
const fn theme_variant(self: &Self) -> PlatformThemeVariant
```

System theme variant or mode.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L76)

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

### with_theme_variant

```rust
const fn with_theme_variant(self: Self, value: PlatformThemeVariant) -> Self
```

Returns the values with the given theme variant.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L81)

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

### contrast_preference

```rust
const fn contrast_preference(self: &Self) -> ColorContrastPreference
```

System high contrast preference.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L87)

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

### with_contrast_preference

```rust
const fn with_contrast_preference(self: Self, value: ColorContrastPreference) -> Self
```

Returns the values with the given contrast preference.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L92)

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

### accent_color1

```rust
const fn accent_color1(self: &Self) -> Color
```

Primary system accent color.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L98)

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

### with_accent_color1

```rust
const fn with_accent_color1(self: Self, value: Color) -> Self
```

Returns the values with the given primary accent color.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L103)

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

### accent_color2

```rust
fn accent_color2(self: &Self) -> Color
```

Secondary system accent color. On some platforms can return the
same value as `accent_color1`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L110)

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

### with_accent_color2

```rust
const fn with_accent_color2(self: Self, value: Color) -> Self
```

Returns the values with the given secondary accent color.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L119)

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

### accent_color3

```rust
fn accent_color3(self: &Self) -> Color
```

Tertiary system accent color. On some platforms can return the same
value as `accent_color1`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L126)

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

### with_accent_color3

```rust
const fn with_accent_color3(self: Self, value: Color) -> Self
```

Returns the values with the given tertiary accent color.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L135)

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

### accent_shades

```rust
const fn accent_shades(self: &Self) -> Option<AccentColorShades>
```

The shades of the primary accent color as the system computes them,
if the platform reports them (Windows does); `None` otherwise, and by
default. A FerroUI addition.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L143)

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

### with_accent_shades

```rust
const fn with_accent_shades(self: Self, value: Option<AccentColorShades>) -> Self
```

Returns the values with the given shades of the primary accent color,
or without shades for `None`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/platform_color_values.rs#L149)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- `Default`

## Availability

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