use crate::{frame::Frame, pixel::Pixel, view::View}; impl View<&mut Frame> { pub fn draw_box(&mut self, color: Pixel) { let w = self.size.x; let h = self.size.y; for x in 0..w { self[(x, 0)] = color; self[(x, h - 1)] = color; } for y in 0..h { self[(0, y)] = color; self[(w - 1, y)] = color; } } } impl Pixel { pub const RED: Pixel = Pixel { r: 255, g: 0, b: 0 }; pub const GREEN: Pixel = Pixel { r: 0, g: 255, b: 0 }; pub const BLUE: Pixel = Pixel { r: 0, g: 0, b: 255 }; }