palette

Type Alias LinSrgba

source
pub type LinSrgba<T = f32> = Rgba<Linear<Srgb>, T>;
Expand description

Linear sRGB with an alpha component.

You probably want Srgba if you are looking for an input or output format (or “just RGB”). This is the linear version of sRGBA, which is what you would usually convert to before working with the color.

See Rgb, Rgba and Alpha for more details on how to create a value and use it.

Aliased Type§

struct LinSrgba<T = f32> {
    pub color: Rgb<Linear<Srgb>, T>,
    pub alpha: T,
}

Fields§

§color: Rgb<Linear<Srgb>, T>

The color.

§alpha: T

The transparency component. 0.0 (or 0u8) is fully transparent and 1.0 (or 255u8) is fully opaque.

Trait Implementations§

source§

impl<T, U> From<Alpha<Rgb<Srgb, T>, T>> for LinSrgba<U>
where U: FromStimulus<T>, Srgb: RgbStandard<Space = Srgb> + IntoLinear<U, T>,

source§

fn from(srgba: Srgba<T>) -> Self

Converts to this type from the input type.
source§

impl<T, U> From<Rgb<Srgb, T>> for LinSrgba<U>
where U: Stimulus, Srgb: RgbStandard<Space = Srgb> + IntoLinear<U, T>,

source§

fn from(srgb: Srgb<T>) -> Self

Converts to this type from the input type.