pixelar 0.1.0

Show everyone the art hidden inside your code.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{
    pixels_table::DrawingContext,
    prelude::{ColorSelector, Drawable, RgbColor},
};

pub struct Point(RgbColor);

impl Point {
    pub fn new<C: ColorSelector>(color: C) -> Self {
        Self(color.rgb_color())
    }
}

impl Drawable<1, 1> for Point {
    fn setup(&self, drawing_ctx: &mut DrawingContext<1, 1>) {
        drawing_ctx.fill(self.0);
    }
}