Type Alias palette::GammaSrgba

source ·
pub type GammaSrgba<T = f32> = Rgba<Gamma<Srgb>, T>;
Expand description

Gamma 2.2 encoded sRGB with an alpha component.

This is similar to Srgba, but uses the exponent function as an approximation. It’s a common trick to speed up conversion when accuracy can be sacrificed. It’s still faster to use Srgba when also converting to and from u8 at the same time.

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

Aliased Type§

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

Fields§

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

The color.

§alpha: T

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