# ColorPreviewer

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

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

```rust
struct ColorPreviewer
```

Presents a preview color with optional accent colors.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`on_color_changed`](#function-on_color_changed)
- [`TEMPLATE_PARTS`](#assoc_const-template_parts)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`color_changed`](#function-color_changed)
- [`hsv_color_property`](#function-hsv_color_property)
- [`is_accent_colors_visible_property`](#function-is_accent_colors_visible_property)
- [`hsv_color`](#function-hsv_color)
- [`set_hsv_color`](#function-set_hsv_color)
- [`is_accent_colors_visible`](#function-is_accent_colors_visible)
- [`set_is_accent_colors_visible`](#function-set_is_accent_colors_visible)

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

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<ColorPreviewer>
```

Returns a strong reference to this object.

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

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

### on_color_changed

```rust
fn on_color_changed(self: &Self, e: &ColorChangedEventArgs)
```

Raises the color changed event.

`e` defines the old/new colors.

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

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

### TEMPLATE_PARTS

```rust
const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
```

The named parts expected in the control template.

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

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

### construct

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

Creates the class data; see `ferroui_base::FerroObject::construct`.

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

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

### new

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

Initializes a new instance of the `ColorPreviewer` class.

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

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

### color_changed

```rust
fn color_changed(self: &Self, handler: impl Fn(&ColorChangedEventArgs) -> () + 'static) -> Rc<dyn IDisposable>
```

Event for when the selected color changes within the previewer.
This occurs when an accent color is pressed. Disposing the returned
handle unsubscribes.

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

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

### hsv_color_property

```rust
fn hsv_color_property() -> &'static StyledProperty<HsvColor>
```

Defines the `HsvColor` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_previewer/color_previewer_properties.rs#L6)

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

### is_accent_colors_visible_property

```rust
fn is_accent_colors_visible_property() -> &'static StyledProperty<bool>
```

Defines the `IsAccentColorsVisible` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_previewer/color_previewer_properties.rs#L6)

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

### hsv_color

```rust
fn hsv_color(self: &Self) -> HsvColor
```

Gets the currently previewed color in the HSV color model.

Only an HSV color is supported in this control to ensure there is never any
loss of precision or color information. Accent colors, like the color spectrum,
only operate with the HSV color model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_previewer/color_previewer_properties.rs#L31)

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

### set_hsv_color

```rust
fn set_hsv_color(self: &Self, value: HsvColor)
```

Sets `hsv_color`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_previewer/color_previewer_properties.rs#L36)

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

### is_accent_colors_visible

```rust
fn is_accent_colors_visible(self: &Self) -> bool
```

Gets a value indicating whether accent colors are visible along
with the preview color.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_previewer/color_previewer_properties.rs#L42)

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

### set_is_accent_colors_visible

```rust
fn set_is_accent_colors_visible(self: &Self, value: bool)
```

Sets `is_accent_colors_visible`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.ColorPicker/color_previewer/color_previewer_properties.rs#L47)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<ColorPreviewer>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`ColorPreviewerImpl`](/docs/0.5.0/api/ferroui-controls-color-picker/primitives/trait-colorpreviewerimpl/)

## Availability

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