a TON of stuff and changes

This commit is contained in:
Simon Gardling
2021-03-26 13:44:58 +00:00
parent e694c48d0a
commit 50b3f35059
11 changed files with 224 additions and 51 deletions

View File

@@ -9,14 +9,14 @@ pub fn random_palette() -> Palette {
let mut rng = thread_rng();
let mut palette = PALETTES[rng.gen_range(0..PALETTES.len())];
palette.colors.shuffle(&mut rng);
palette
return palette;
}
const fn hex_to_color(c: usize) -> image::Rgb<u8> {
let r = (c >> 16) & 0xff;
let g = (c >> 8) & 0xff;
let b = (c >> 0) & 0xff;
image::Rgb::<u8>([r as u8, g as u8, b as u8])
return image::Rgb::<u8>([r as u8, g as u8, b as u8]);
}
const PALETTES: [Palette; 8] = [