ceratophrys 0.0.3

Library to draw pixel art as code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{filters::Filter, Color, Image};

#[derive(Debug, Clone, Copy)]
pub struct Silhouette;

impl Filter for Silhouette {
    fn filter(&self, image: &mut Image) {
        for color in image.pixels.values_mut() {
            if !color.is_transparent() {
                *color = Color::BLACK;
            }
        }
        for child in &mut image.children {
            self.filter(child);
        }
    }
}