pub trait RgbColor: PixelColor {
    const MAX_R: u8;
    const MAX_G: u8;
    const MAX_B: u8;
    const BLACK: Self;
    const RED: Self;
    const GREEN: Self;
    const BLUE: Self;
    const YELLOW: Self;
    const MAGENTA: Self;
    const CYAN: Self;
    const WHITE: Self;

    // Required methods
    fn r(&self) -> u8;
    fn g(&self) -> u8;
    fn b(&self) -> u8;
}
Expand description

RGB color.

Required Associated Constants§

source

const MAX_R: u8

The maximum value in the red channel.

source

const MAX_G: u8

The maximum value in the green channel.

source

const MAX_B: u8

The maximum value in the blue channel.

source

const BLACK: Self

Black color (R: 0%, G: 0%, B: 0%)

source

const RED: Self

Red color (R: 100%, G: 0%, B: 0%)

source

const GREEN: Self

Green color (R: 0%, G: 100%, B: 0%)

source

const BLUE: Self

Blue color (R: 0%, G: 0%, B: 100%)

source

const YELLOW: Self

Yellow color (R: 100%, G: 100%, B: 0%)

source

const MAGENTA: Self

Magenta color (R: 100%, G: 0%, B: 100%)

source

const CYAN: Self

Cyan color (R: 0%, G: 100%, B: 100%)

source

const WHITE: Self

White color (R: 100%, G: 100%, B: 100%)

Required Methods§

source

fn r(&self) -> u8

Returns the red channel value.

source

fn g(&self) -> u8

Returns the green channel value.

source

fn b(&self) -> u8

Returns the blue channel value.

Implementors§

source§

impl RgbColor for Bgr555

source§

const MAX_R: u8 = 31u8

source§

const MAX_G: u8 = 31u8

source§

const MAX_B: u8 = 31u8

source§

const BLACK: Bgr555 = Self::new(0, 0, 0)

source§

const RED: Bgr555 = Self::new(Self::MAX_R, 0, 0)

source§

const GREEN: Bgr555 = Self::new(0, Self::MAX_G, 0)

source§

const BLUE: Bgr555 = Self::new(0, 0, Self::MAX_B)

source§

const YELLOW: Bgr555 = Self::new(Self::MAX_R, Self::MAX_G, 0)

source§

const MAGENTA: Bgr555 = Self::new(Self::MAX_R, 0, Self::MAX_B)

source§

const CYAN: Bgr555 = Self::new(0, Self::MAX_G, Self::MAX_B)

source§

const WHITE: Bgr555 = Self::new(Self::MAX_R, Self::MAX_G, Self::MAX_B)

source§

impl RgbColor for Bgr565

source§

const MAX_R: u8 = 31u8

source§

const MAX_G: u8 = 63u8

source§

const MAX_B: u8 = 31u8

source§

const BLACK: Bgr565 = Self::new(0, 0, 0)

source§

const RED: Bgr565 = Self::new(Self::MAX_R, 0, 0)

source§

const GREEN: Bgr565 = Self::new(0, Self::MAX_G, 0)

source§

const BLUE: Bgr565 = Self::new(0, 0, Self::MAX_B)

source§

const YELLOW: Bgr565 = Self::new(Self::MAX_R, Self::MAX_G, 0)

source§

const MAGENTA: Bgr565 = Self::new(Self::MAX_R, 0, Self::MAX_B)

source§

const CYAN: Bgr565 = Self::new(0, Self::MAX_G, Self::MAX_B)

source§

const WHITE: Bgr565 = Self::new(Self::MAX_R, Self::MAX_G, Self::MAX_B)

source§

impl RgbColor for Bgr666

source§

const MAX_R: u8 = 63u8

source§

const MAX_G: u8 = 63u8

source§

const MAX_B: u8 = 63u8

source§

const BLACK: Bgr666 = Self::new(0, 0, 0)

source§

const RED: Bgr666 = Self::new(Self::MAX_R, 0, 0)

source§

const GREEN: Bgr666 = Self::new(0, Self::MAX_G, 0)

source§

const BLUE: Bgr666 = Self::new(0, 0, Self::MAX_B)

source§

const YELLOW: Bgr666 = Self::new(Self::MAX_R, Self::MAX_G, 0)

source§

const MAGENTA: Bgr666 = Self::new(Self::MAX_R, 0, Self::MAX_B)

source§

const CYAN: Bgr666 = Self::new(0, Self::MAX_G, Self::MAX_B)

source§

const WHITE: Bgr666 = Self::new(Self::MAX_R, Self::MAX_G, Self::MAX_B)

source§

impl RgbColor for Bgr888

source§

const MAX_R: u8 = 255u8

source§

const MAX_G: u8 = 255u8

source§

const MAX_B: u8 = 255u8

source§

const BLACK: Bgr888 = Self::new(0, 0, 0)

source§

const RED: Bgr888 = Self::new(Self::MAX_R, 0, 0)

source§

const GREEN: Bgr888 = Self::new(0, Self::MAX_G, 0)

source§

const BLUE: Bgr888 = Self::new(0, 0, Self::MAX_B)

source§

const YELLOW: Bgr888 = Self::new(Self::MAX_R, Self::MAX_G, 0)

source§

const MAGENTA: Bgr888 = Self::new(Self::MAX_R, 0, Self::MAX_B)

source§

const CYAN: Bgr888 = Self::new(0, Self::MAX_G, Self::MAX_B)

source§

const WHITE: Bgr888 = Self::new(Self::MAX_R, Self::MAX_G, Self::MAX_B)

source§

impl RgbColor for Rgb555

source§

const MAX_R: u8 = 31u8

source§

const MAX_G: u8 = 31u8

source§

const MAX_B: u8 = 31u8

source§

const BLACK: Rgb555 = Self::new(0, 0, 0)

source§

const RED: Rgb555 = Self::new(Self::MAX_R, 0, 0)

source§

const GREEN: Rgb555 = Self::new(0, Self::MAX_G, 0)

source§

const BLUE: Rgb555 = Self::new(0, 0, Self::MAX_B)

source§

const YELLOW: Rgb555 = Self::new(Self::MAX_R, Self::MAX_G, 0)

source§

const MAGENTA: Rgb555 = Self::new(Self::MAX_R, 0, Self::MAX_B)

source§

const CYAN: Rgb555 = Self::new(0, Self::MAX_G, Self::MAX_B)

source§

const WHITE: Rgb555 = Self::new(Self::MAX_R, Self::MAX_G, Self::MAX_B)

source§

impl RgbColor for Rgb565

source§

const MAX_R: u8 = 31u8

source§

const MAX_G: u8 = 63u8

source§

const MAX_B: u8 = 31u8

source§

const BLACK: Rgb565 = Self::new(0, 0, 0)

source§

const RED: Rgb565 = Self::new(Self::MAX_R, 0, 0)

source§

const GREEN: Rgb565 = Self::new(0, Self::MAX_G, 0)

source§

const BLUE: Rgb565 = Self::new(0, 0, Self::MAX_B)

source§

const YELLOW: Rgb565 = Self::new(Self::MAX_R, Self::MAX_G, 0)

source§

const MAGENTA: Rgb565 = Self::new(Self::MAX_R, 0, Self::MAX_B)

source§

const CYAN: Rgb565 = Self::new(0, Self::MAX_G, Self::MAX_B)

source§

const WHITE: Rgb565 = Self::new(Self::MAX_R, Self::MAX_G, Self::MAX_B)

source§

impl RgbColor for Rgb666

source§

const MAX_R: u8 = 63u8

source§

const MAX_G: u8 = 63u8

source§

const MAX_B: u8 = 63u8

source§

const BLACK: Rgb666 = Self::new(0, 0, 0)

source§

const RED: Rgb666 = Self::new(Self::MAX_R, 0, 0)

source§

const GREEN: Rgb666 = Self::new(0, Self::MAX_G, 0)

source§

const BLUE: Rgb666 = Self::new(0, 0, Self::MAX_B)

source§

const YELLOW: Rgb666 = Self::new(Self::MAX_R, Self::MAX_G, 0)

source§

const MAGENTA: Rgb666 = Self::new(Self::MAX_R, 0, Self::MAX_B)

source§

const CYAN: Rgb666 = Self::new(0, Self::MAX_G, Self::MAX_B)

source§

const WHITE: Rgb666 = Self::new(Self::MAX_R, Self::MAX_G, Self::MAX_B)

source§

impl RgbColor for Rgb888

source§

const MAX_R: u8 = 255u8

source§

const MAX_G: u8 = 255u8

source§

const MAX_B: u8 = 255u8

source§

const BLACK: Rgb888 = Self::new(0, 0, 0)

source§

const RED: Rgb888 = Self::new(Self::MAX_R, 0, 0)

source§

const GREEN: Rgb888 = Self::new(0, Self::MAX_G, 0)

source§

const BLUE: Rgb888 = Self::new(0, 0, Self::MAX_B)

source§

const YELLOW: Rgb888 = Self::new(Self::MAX_R, Self::MAX_G, 0)

source§

const MAGENTA: Rgb888 = Self::new(Self::MAX_R, 0, Self::MAX_B)

source§

const CYAN: Rgb888 = Self::new(0, Self::MAX_G, Self::MAX_B)

source§

const WHITE: Rgb888 = Self::new(Self::MAX_R, Self::MAX_G, Self::MAX_B)