# DistantLight

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/rendering/composition/struct-distantlight/

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

```rust
struct DistantLight
```

A light from far away in one direction (WinUI
`Microsoft.UI.Composition.DistantLight`): every point of a flat
visual is lit alike, by the cosine of the angle between the direction
and the visual. `Color`, `Direction` and `Intensity` are animatable.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L399)

## Members

- [`from_light`](#function-from_light)
- [`color`](#function-color)
- [`set_color`](#function-set_color)
- [`coordinate_space`](#function-coordinate_space)
- [`set_coordinate_space`](#function-set_coordinate_space)
- [`direction`](#function-direction)
- [`set_direction`](#function-set_direction)
- [`intensity`](#function-intensity)
- [`set_intensity`](#function-set_intensity)

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

### from_light

```rust
fn from_light(light: &Rc<CompositionLight>) -> Option<DistantLight>
```

The handle of `light` as this class, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L399)

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

### color

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

The colour of the light (default white).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L419)

<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/rendering/composition/composition_light.rs#L423)

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

### coordinate_space

```rust
fn coordinate_space(self: &Self) -> Option<Rc<CompositionVisual>>
```

The visual whose coordinates `Direction` is in; `None` for the
targeted visual.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L429)

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

### set_coordinate_space

```rust
fn set_coordinate_space(self: &Self, value: Option<Rc<CompositionVisual>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L433)

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

### direction

```rust
fn direction(self: &Self) -> Vector3D
```

The direction the light shines in (default `(0, 0, -1)`: straight at
a visual, which faces +Z).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L439)

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

### set_direction

```rust
fn set_direction(self: &Self, value: Vector3D)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L443)

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

### intensity

```rust
fn intensity(self: &Self) -> f32
```

The intensity of the light (default 1).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L448)

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

### set_intensity

```rust
fn set_intensity(self: &Self, value: f32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/composition_light.rs#L452)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Deref`

## Availability

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