# SpotLight

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

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

```rust
struct SpotLight
```

A light from a point into a cone (WinUI
`Microsoft.UI.Composition.SpotLight`): a point light whose light is
the inner cone colour inside the inner cone, falls off to the outer
cone colour and to nothing at the edge of the outer cone, and is
nothing outside it. The cone angles are measured from the direction
to the edge of the cone, in radians. Every member but
`CoordinateSpace` is animatable.

Deviation (winui-composition.md): `InnerConeAngleInDegrees` and
`OuterConeAngleInDegrees` are views of the radians and cannot be the
target of an animation.

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

## Members

- [`from_light`](#function-from_light)
- [`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)
- [`direction`](#function-direction)
- [`set_direction`](#function-set_direction)
- [`inner_cone_angle`](#function-inner_cone_angle)
- [`set_inner_cone_angle`](#function-set_inner_cone_angle)
- [`inner_cone_angle_in_degrees`](#function-inner_cone_angle_in_degrees)
- [`set_inner_cone_angle_in_degrees`](#function-set_inner_cone_angle_in_degrees)
- [`inner_cone_color`](#function-inner_cone_color)
- [`set_inner_cone_color`](#function-set_inner_cone_color)
- [`inner_cone_intensity`](#function-inner_cone_intensity)
- [`set_inner_cone_intensity`](#function-set_inner_cone_intensity)
- [`outer_cone_angle`](#function-outer_cone_angle)
- [`set_outer_cone_angle`](#function-set_outer_cone_angle)
- [`outer_cone_angle_in_degrees`](#function-outer_cone_angle_in_degrees)
- [`set_outer_cone_angle_in_degrees`](#function-set_outer_cone_angle_in_degrees)
- [`outer_cone_color`](#function-outer_cone_color)
- [`set_outer_cone_color`](#function-set_outer_cone_color)
- [`outer_cone_intensity`](#function-outer_cone_intensity)
- [`set_outer_cone_intensity`](#function-set_outer_cone_intensity)
- [`offset`](#function-offset)
- [`set_offset`](#function-set_offset)
- [`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<SpotLight>
```

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

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

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

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

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

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

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

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

### coordinate_space

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

The visual whose coordinates `Offset` and `Direction` are in; `None`
for the targeted visual.

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

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

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

### direction

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

The direction the light shines in (default `(0, 0, -1)`).

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

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

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

### inner_cone_angle

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

The angle from the direction to the edge of the inner cone, in
radians (default 0).

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

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

### set_inner_cone_angle

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



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

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

### inner_cone_angle_in_degrees

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

The inner cone angle in degrees: a view of
`inner_cone_angle`.

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

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

### set_inner_cone_angle_in_degrees

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



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

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

### inner_cone_color

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

The colour of the light inside the inner cone (default white).

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

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

### set_inner_cone_color

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



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

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

### inner_cone_intensity

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

The intensity of the light inside the inner cone (default 1).

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

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

### set_inner_cone_intensity

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



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

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

### outer_cone_angle

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

The angle from the direction to the edge of the outer cone, in
radians (default pi / 4).

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

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

### set_outer_cone_angle

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



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

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

### outer_cone_angle_in_degrees

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

The outer cone angle in degrees: a view of
`outer_cone_angle`.

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

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

### set_outer_cone_angle_in_degrees

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



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

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

### outer_cone_color

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

The colour of the light between the inner and the outer cone
(default white).

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

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

### set_outer_cone_color

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



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

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

### outer_cone_intensity

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

The intensity of the light between the inner and the outer cone
(default 1).

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

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

### set_outer_cone_intensity

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



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

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

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

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

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

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

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

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