embedded_graphics::pixelcolor

Trait GrayColor

Source
pub trait GrayColor: PixelColor {
    const BLACK: Self;
    const WHITE: Self;

    // Required method
    fn luma(&self) -> u8;
}
Expand description

Grayscale color.

Required Associated Constants§

Source

const BLACK: Self

Black color (0% luma)

Source

const WHITE: Self

White color (100% luma)

Required Methods§

Source

fn luma(&self) -> u8

Returns the luma channel value.

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 GrayColor for Gray2

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl GrayColor for Gray4

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _

Source§

impl GrayColor for Gray8

Source§

const BLACK: Self = _

Source§

const WHITE: Self = _