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§

impl RgbColor for Bgr565

Source§

impl RgbColor for Bgr666

Source§

impl RgbColor for Bgr888

Source§

impl RgbColor for Rgb555

Source§

impl RgbColor for Rgb565

Source§

impl RgbColor for Rgb666

Source§

impl RgbColor for Rgb888