bevy_color

Trait Gray

Source
pub trait Gray: Mix + Sized {
    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§

Source§

impl Gray for Hsla

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl Gray for Hsva

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl Gray for Hwba

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl Gray for Laba

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl Gray for Lcha

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl Gray for LinearRgba

Source§

const BLACK: Self = Self::BLACK

Source§

const WHITE: Self = Self::WHITE

Source§

impl Gray for Oklaba

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl Gray for Oklcha

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl Gray for Srgba

Source§

const BLACK: Self = Self::BLACK

Source§

const WHITE: Self = Self::WHITE

Source§

impl Gray for Xyza

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _