embedded_graphics::pixelcolor

Trait RgbColor

Source
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.

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 RgbColor for Bgr555

Source§

const MAX_R: u8 = 31u8

Source§

const MAX_G: u8 = 31u8

Source§

const MAX_B: u8 = 31u8

Source§

const BLACK: Self = _

Source§

const RED: Self = _

Source§

const GREEN: Self = _

Source§

const BLUE: Self = _

Source§

const YELLOW: Self = _

Source§

const MAGENTA: Self = _

Source§

const CYAN: Self = _

Source§

const WHITE: Self = _

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: Self = _

Source§

const RED: Self = _

Source§

const GREEN: Self = _

Source§

const BLUE: Self = _

Source§

const YELLOW: Self = _

Source§

const MAGENTA: Self = _

Source§

const CYAN: Self = _

Source§

const WHITE: Self = _

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: Self = _

Source§

const RED: Self = _

Source§

const GREEN: Self = _

Source§

const BLUE: Self = _

Source§

const YELLOW: Self = _

Source§

const MAGENTA: Self = _

Source§

const CYAN: Self = _

Source§

const WHITE: Self = _

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: Self = _

Source§

const RED: Self = _

Source§

const GREEN: Self = _

Source§

const BLUE: Self = _

Source§

const YELLOW: Self = _

Source§

const MAGENTA: Self = _

Source§

const CYAN: Self = _

Source§

const WHITE: Self = _

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: Self = _

Source§

const RED: Self = _

Source§

const GREEN: Self = _

Source§

const BLUE: Self = _

Source§

const YELLOW: Self = _

Source§

const MAGENTA: Self = _

Source§

const CYAN: Self = _

Source§

const WHITE: Self = _

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: Self = _

Source§

const RED: Self = _

Source§

const GREEN: Self = _

Source§

const BLUE: Self = _

Source§

const YELLOW: Self = _

Source§

const MAGENTA: Self = _

Source§

const CYAN: Self = _

Source§

const WHITE: Self = _