# SolidColorBrush

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/struct-solidcolorbrush/

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

```rust
struct SolidColorBrush
```

Fills an area with a solid color.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L15)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`color_property`](#function-color_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_color`](#function-with_color)
- [`with_color_and_opacity`](#function-with_color_and_opacity)
- [`from_uint32`](#function-from_uint32)
- [`color`](#function-color)
- [`set_color`](#function-set_color)
- [`parse`](#function-parse)
- [`to_immutable`](#function-to_immutable)

<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.Base/media/solid_color_brush.rs#L19)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L19)

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

### color_property

```rust
fn color_property() -> &'static StyledProperty<Color>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L34)

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

### construct

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

Creates the class data.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L42)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L46)

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

### with_color

```rust
fn with_color(color: Color) -> Ref<Self>
```

Creates a brush with the given color.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L51)

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

### with_color_and_opacity

```rust
fn with_color_and_opacity(color: Color, opacity: f64) -> Ref<Self>
```

Creates a brush with the given color and opacity.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L56)

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

### from_uint32

```rust
fn from_uint32(color: u32) -> Ref<Self>
```

Creates a brush with the color given as an `0xAARRGGBB` value.

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

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

### color

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

The color of the brush.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L69)

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

### set_color

```rust
fn set_color(self: &Self, value: Color)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L73)

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

### parse

```rust
fn parse(s: &str) -> Result<Ref<SolidColorBrush>, FormatError>
```

Parses a brush string.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L78)

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

### to_immutable

```rust
fn to_immutable(self: &Self) -> Rc<dyn IImmutableBrush>
```

Creates an immutable clone of the brush.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/solid_color_brush.rs#L88)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`BrushImplExt`](/docs/0.5.0/api/ferroui-base/media/trait-brushimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `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`
- `ToString`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<SolidColorBrush>`](/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/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`BrushImpl`](/docs/0.5.0/api/ferroui-base/media/trait-brushimpl/)
- `Display`

## Availability

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