Trait cushy::styles::Lightness

source ·
pub trait Lightness {
    // Required method
    fn into_lightness(self) -> ZeroToOne;
}
Expand description

A value that can represent the lightness of a color.

This is implemented for these types:

  • ZeroToOne: A range of 0.0 to 1.0.
  • f32: Values are clamped to 0.0 and 1.0. Panics if NaN.
  • u8: A range of 0 to 100. Values above 100 are clamped.

Required Methods§

source

fn into_lightness(self) -> ZeroToOne

Returns this value as a floating point clamped between 0 and 1.

Implementations on Foreign Types§

source§

impl Lightness for f32

source§

impl Lightness for u8

Implementors§