# DiffuseMaterial

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-media3d/struct-diffusematerial/

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

```rust
struct DiffuseMaterial
```

WPF's `DiffuseMaterial`: its `Brush`, filtered by `Color`, lit by the lights (the ambient
lights through `AmbientColor`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L88)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`color_property`](#function-color_property)
- [`ambient_color_property`](#function-ambient_color_property)
- [`brush_property`](#function-brush_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_brush`](#function-with_brush)
- [`color`](#function-color)
- [`set_color`](#function-set_color)
- [`ambient_color`](#function-ambient_color)
- [`set_ambient_color`](#function-set_ambient_color)
- [`brush`](#function-brush)
- [`set_brush`](#function-set_brush)

<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.Media3D/material.rs#L92)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L92)

<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.Media3D/material.rs#L110)

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

### ambient_color_property

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L110)

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

### brush_property

```rust
fn brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L110)

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

### construct

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

Creates the class data.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L124)

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

### new

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

A material without a brush (it paints nothing until it has one).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L129)

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

### with_brush

```rust
fn with_brush(brush: Option<Rc<dyn IBrush>>) -> Ref<Self>
```

A material of `brush`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L134)

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

### color

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

The colour that filters the brush (white by default).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L141)

<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.Media3D/material.rs#L145)

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

### ambient_color

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

The colour that filters the ambient light (white by default).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L150)

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

### set_ambient_color

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L154)

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

### brush

```rust
fn brush(self: &Self) -> Option<Rc<dyn IBrush>>
```

The brush.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L159)

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

### set_brush

```rust
fn set_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/material.rs#L163)

## 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`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<DiffuseMaterial>`](/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/)

## Availability

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