Trait Gray

Source
pub trait Gray: Sized + Mix {
    const BLACK: Self;
    const WHITE: Self;

    // Provided method
    fn gray(lightness: f32) -> Self { ... }
}
Expand description

Trait for returning a grayscale color of a provided lightness.

Required Associated Constants§

Source

const BLACK: Self

A pure black color.

Source

const WHITE: Self

A pure white color.

Provided Methods§

Source

fn gray(lightness: f32) -> Self

Returns a grey color with the provided lightness from (0.0 - 1.0). 0 is black, 1 is white.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§