# BrightnessContrastEffect

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

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

```rust
struct BrightnessContrastEffect
```

Changes the brightness and the contrast of the content (Effector's
`BrightnessContrastEffect`): each colour channel `c` becomes
`contrast * c + (1 - contrast) / 2 + brightness`, the brightness clamped
to -1..1 and the contrast to 0..2.5; the alpha is kept.

`brightness-contrast(brightness=0.1, contrast=1.3)`. The graph is a
linear transfer (`Transfer.RedSlope`, `Transfer.RedOffset`, ...).

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

## Members

- [`brightness`](#struct_field-brightness)
- [`contrast`](#struct_field-contrast)
- [`MAXIMUM_CONTRAST`](#assoc_const-maximum_contrast)
- [`matrix`](#function-matrix)

<a id="struct_field-brightness"></a>

### brightness

```rust
brightness: f64
```

The brightness added, -1 to 1 (default 0).

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

<a id="struct_field-contrast"></a>

### contrast

```rust
contrast: f64
```

The contrast, 0 (grey) to 2.5, 1 unchanged (default 1).

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

<a id="assoc_const-maximum_contrast"></a>

### MAXIMUM_CONTRAST

```rust
const MAXIMUM_CONTRAST: f64
```

The largest contrast.

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

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

### matrix

```rust
fn matrix(self: &Self) -> ColorMatrix
```

The colour matrix of the effect.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`
- [`CustomEffect`](/docs/0.5.0/api/ferroui-base/media/effects/trait-customeffect/)

## Availability

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