palette

Type Alias Srgba

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

Non-linear sRGB with an alpha component.

This is a transparent version of Srgb, which is commonly used as the input or output format. If you are looking for “just RGBA”, this is probably it.

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

Aliased Type§

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

Fields§

§color: Rgb<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<Linear<Srgb>, T>, T>> for Srgba<U>
where U: FromStimulus<T>, Srgb: RgbStandard<Space = Srgb> + FromLinear<T, U>,

source§

fn from(lin_srgba: LinSrgba<T>) -> Self

Converts to this type from the input type.
source§

impl<T, U> From<Rgb<Linear<Srgb>, T>> for Srgba<U>
where U: Stimulus, Srgb: RgbStandard<Space = Srgb> + FromLinear<T, U>,

source§

fn from(lin_srgb: LinSrgb<T>) -> Self

Converts to this type from the input type.