# PointLight

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

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

```rust
struct PointLight
```

A light from a point (WinUI `Microsoft.UI.Composition.PointLight`):
a point of a visual is lit by the cosine of the angle of the light to
the visual, weakened by the attenuation of the distance
`1 / (constant + linear * d + quadratic * d^2)` between the minimum and
the maximum cutoff. Every member but `CoordinateSpace` is animatable.

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

## Members

- [`from_light`](#function-from_light)
- [`color`](#function-color)
- [`set_color`](#function-set_color)
- [`constant_attenuation`](#function-constant_attenuation)
- [`set_constant_attenuation`](#function-set_constant_attenuation)
- [`linear_attenuation`](#function-linear_attenuation)
- [`set_linear_attenuation`](#function-set_linear_attenuation)
- [`quadratic_attenuation`](#function-quadratic_attenuation)
- [`set_quadratic_attenuation`](#function-set_quadratic_attenuation)
- [`coordinate_space`](#function-coordinate_space)
- [`set_coordinate_space`](#function-set_coordinate_space)
- [`offset`](#function-offset)
- [`set_offset`](#function-set_offset)
- [`intensity`](#function-intensity)
- [`set_intensity`](#function-set_intensity)
- [`min_attenuation_cutoff`](#function-min_attenuation_cutoff)
- [`set_min_attenuation_cutoff`](#function-set_min_attenuation_cutoff)
- [`max_attenuation_cutoff`](#function-max_attenuation_cutoff)
- [`set_max_attenuation_cutoff`](#function-set_max_attenuation_cutoff)

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

### from_light

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

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#L457)

<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#L478)

<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#L482)

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

### constant_attenuation

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

The constant term of the attenuation (default 1).

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

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

### set_constant_attenuation

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



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

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

### linear_attenuation

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

The term of the attenuation proportional to the distance (default 0).

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

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

### set_linear_attenuation

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



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

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

### quadratic_attenuation

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

The term of the attenuation proportional to the square of the
distance (default 0).

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

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

### set_quadratic_attenuation

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



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

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

### coordinate_space

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

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

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

<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#L520)

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

### offset

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

The position of the light in its coordinate space; Z is the height
above the visuals.

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

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

### set_offset

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



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

<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#L535)

<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#L539)

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

### min_attenuation_cutoff

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

The distance up to which the light is not attenuated (default 0).

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

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

### set_min_attenuation_cutoff

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



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

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

### max_attenuation_cutoff

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

The distance beyond which the light lights nothing (default
`f32::MAX`).

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

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

### set_max_attenuation_cutoff

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



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

## 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/).
