1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use embedded_graphics::pixelcolor::RgbColor;

pub mod vga;

#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Pixel {
    pub r: u8,
    pub g: u8,
    pub b: u8,
}

impl<T: RgbColor> From<T> for Pixel {
    fn from(color: T) -> Self {
        Self {
            r: color.r(),
            g: color.g(),
            b: color.b(),
        }
    }
}