FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    BrightnessContrastEffect

    struct · ferroui-base · v0.5.0

    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

    Members

    brightness

    brightness: f64
    

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

    Source

    contrast

    contrast: f64
    

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

    Source

    MAXIMUM_CONTRAST

    const MAXIMUM_CONTRAST: f64
    

    The largest contrast.

    Source

    matrix

    fn matrix(self: &Self) -> ColorMatrix
    

    The colour matrix of the effect.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default
    • CustomEffect

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.