summary refs log tree commit diff
path: root/rs
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-03-28 13:54:45 -0400
committerJune McEnroe <programble@gmail.com>2018-03-28 13:54:45 -0400
commite10a2897d30764c2ad338556e6994b329ad88785 (patch)
tree826cf7ab4c20ccf77dde1fa263f134d23b824c54 /rs
parentAdd ll alias (diff)
downloadsrc-e10a2897d30764c2ad338556e6994b329ad88785.tar.gz
src-e10a2897d30764c2ad338556e6994b329ad88785.zip
Add Rust script for generating a rainbow palette
Diffstat (limited to 'rs')
-rw-r--r--rs/palette.rs11
1 files changed, 11 insertions, 0 deletions
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);
+    }
+}