Type Alias palette::Srgb

source ·
pub type Srgb<T = f32> = Rgb<Srgb, T>;
Expand description

Non-linear sRGB, the most common RGB input/output format.

If you are looking for “just RGB”, this is probably it. This type alias helps by locking the more generic Rgb type to the sRGB format.

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

Aliased Type§

struct Srgb<T = f32> {
    pub red: T,
    pub green: T,
    pub blue: T,
    pub standard: PhantomData<Srgb>,
}

Fields§

§red: T

The amount of red light, where 0.0 is no red light and 1.0 (or 255u8) is the highest displayable amount.

§green: T

The amount of green light, where 0.0 is no green light and 1.0 (or 255u8) is the highest displayable amount.

§blue: T

The amount of blue light, where 0.0 is no blue light and 1.0 (or 255u8) is the highest displayable amount.

§standard: PhantomData<Srgb>

The kind of RGB standard. sRGB is the default.

Trait Implementations§

source§

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

source§

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

Converts to this type from the input type.