From 10f31433b2d3848985e84eccfbe2b0ca5bf1d6cc Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Wed, 28 Mar 2018 13:54:45 -0400 Subject: Add Rust script for generating a rainbow palette --- rs/palette.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 rs/palette.rs (limited to 'rs') diff --git a/rs/palette.rs b/rs/palette.rs new file mode 100644 index 00000000..2b0dec3c --- /dev/null +++ b/rs/palette.rs @@ -0,0 +1,11 @@ +// cargo-deps: hsl +extern crate hsl; + +fn main() { + for i in 0..256 { + let h = i as f64 * 360.0 / 256.0; + let hsl = hsl::HSL { h, s: 1.0, l: 0.5 }; + let (r, g, b) = hsl.to_rgb(); + println!("0x{:02X}{:02X}{:02X},", r, g, b); + } +} -- cgit 1.4.1