Skip to main content

Hsla

Type Alias Hsla 

Source
pub type Hsla<S = Srgb, T = f32> = Alpha<Hsl<S, T>, T>;
Expand description

Linear HSL with an alpha component. See the Hsla implementation in Alpha.

Aliased Type§

#[repr(C)]
pub struct Hsla<S = Srgb, T = f32> { pub color: Hsl<S, T>, pub alpha: T, }

Fields§

§color: Hsl<S, 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 ColorExt for Hsla

Source§

fn blend(&self, other: &Self) -> Self

Composites other over this color with Porter–Duff source-over.
Source§

fn fade_out(&mut self, factor: f32)

Reduces the alpha of this color in place by factor. Read more
Source§

fn opacity(&self, factor: f32) -> Self

Returns a copy of this color with its alpha multiplied by factor. Read more
Source§

impl Interpolate for Hsla

Source§

fn interpolate(from: Self, to: Self, phase: f32) -> Self

Returns the value at phase, where 0.0 is from and 1.0 is to. Read more
Source§

impl Lerp for Hsla

Source§

fn lerp(&self, to: &Self, delta: f32) -> Self

Returns the value delta of the way from self to to.