diff --git a/.gitignore b/.gitignore index bb23b4bd..e49a903b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ .vscode/settings.json +.idea/ target/ /*.svg /*.png +/*.json +/*.yml + diff --git a/Cargo.lock b/Cargo.lock index 62b86c04..80e807bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1784,6 +1784,8 @@ checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown 0.16.1", + "serde", + "serde_core", ] [[package]] @@ -2345,6 +2347,22 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" +[[package]] +name = "noyalib" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4d40221dba649ed01664957d3e0248511fa7b01fd2fb77e6b9041593258f6e" +dependencies = [ + "indexmap", + "itoa", + "memchr", + "rustc-hash 2.1.1", + "ryu", + "serde", + "serde_ignored", + "smallvec", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -2870,6 +2888,15 @@ dependencies = [ "libredox", ] +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + [[package]] name = "ordered-float" version = "5.1.0" @@ -3004,6 +3031,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" name = "plotive" version = "0.5.0" dependencies = [ + "noyalib", "ode_solvers", "plotive-base", "plotive-dsl", @@ -3014,12 +3042,17 @@ dependencies = [ "rand", "rand_chacha", "rand_distr", + "serde", + "serde-value", + "serde_json", ] [[package]] name = "plotive-base" version = "0.5.0" dependencies = [ + "serde", + "serde_json", "strict-num 0.2.0", "tiny-skia-path", ] @@ -3079,6 +3112,7 @@ dependencies = [ "rand", "rand_chacha", "rand_distr", + "serde_json", "similar", "tiny-skia", ] @@ -3570,9 +3604,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "safe_arch" @@ -3633,6 +3667,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float 2.10.1", + "serde", +] + [[package]] name = "serde_core" version = "1.0.228" @@ -3653,16 +3697,27 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_ignored" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115dffd5f3853e06e746965a20dcbae6ee747ae30b543d91b0e089668bb07798" +dependencies = [ + "serde", + "serde_core", +] + [[package]] name = "serde_json" -version = "1.0.142" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", - "ryu", "serde", + "serde_core", + "zmij", ] [[package]] @@ -4694,7 +4749,7 @@ dependencies = [ "ndk-sys", "objc", "once_cell", - "ordered-float", + "ordered-float 5.1.0", "parking_lot", "portable-atomic", "portable-atomic-util", @@ -5443,6 +5498,12 @@ dependencies = [ "syn", ] +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" + [[package]] name = "zune-core" version = "0.4.12" diff --git a/Cargo.toml b/Cargo.toml index 9c1f8d69..b50d9103 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,9 @@ plotive-base.workspace = true plotive-text.workspace = true # feature dsl plotive-dsl = { workspace = true, optional = true } +# feature serde +serde = { workspace = true, optional = true } +serde-value = { version = "0.7", optional = true } [dev-dependencies] plotive-iced = { path = "iced", features = ["clipboard"] } @@ -26,6 +29,9 @@ rand.workspace = true rand_distr.workspace = true rand_chacha.workspace = true ode_solvers = "0.6.1" +serde_json.workspace = true +noyalib = "0.0.6" + [features] default = ["noto-sans"] @@ -37,6 +43,7 @@ noto-sans = ["plotive-text/noto-sans"] noto-sans-italic = ["plotive-text/noto-sans-italic"] noto-serif = ["plotive-text/noto-serif"] noto-serif-italic = ["plotive-text/noto-serif-italic"] +serde = ["plotive-base/serde", "dep:serde", "dep:serde-value"] time = [] utils = [] @@ -73,6 +80,9 @@ required-features = ["data-csv"] name = "iris_dsl" required-features = ["data-csv", "dsl"] +[[example]] +name = "minimal" + [[example]] name = "multiple_axes" required-features = ["utils"] @@ -117,7 +127,6 @@ keywords = ["data", "visualization", "plotting"] plotive = { version = "0.5.0", path = "." } plotive-base = { version = "0.5.0", path = "base" } plotive-dsl = { version = "0.5.0", path = "dsl" } -plotive-iced = { version = "0.5.0", path = "iced" } plotive-pxl = { version = "0.5.0", path = "pxl" } plotive-svg = { version = "0.5.0", path = "svg" } plotive-text = { version = "0.5.0", path = "text" } @@ -137,6 +146,8 @@ rand_distr = "0.5.1" rand_chacha = "0.9.0" rfd = "0.17.1" rustybuzz = "0.20.1" +serde = { version = "1.0.228" } +serde_json = "1.0.149" strict-num = "0.2.0" tiny-skia = "0.11.4" tiny-skia-path = "0.11.4" diff --git a/base/Cargo.toml b/base/Cargo.toml index 8c3377e4..5aa873a8 100644 --- a/base/Cargo.toml +++ b/base/Cargo.toml @@ -12,3 +12,10 @@ keywords.workspace = true [dependencies] tiny-skia-path.workspace = true strict-num.workspace = true +serde = { workspace = true, optional = true } + +[dev-dependencies] +serde_json = { workspace = true } + +[features] +serde = ["dep:serde"] diff --git a/base/src/color.rs b/base/src/color.rs index 67a6540a..cafa71ab 100644 --- a/base/src/color.rs +++ b/base/src/color.rs @@ -2,8 +2,8 @@ use std::str::FromStr; use std::{error, fmt}; -mod css4; -mod xkcd; +pub(crate) mod css4; +pub(crate) mod xkcd; pub use css4::*; @@ -60,7 +60,7 @@ impl Rgba8 { } /// Get the HTML hex string representation of the color, e.g. `#ff0000` for red. - /// If the alpha channel is not 255, the form "rgba(r, g, b, a)" is used. + /// If the alpha channel is not 255, the form "rgba(r, g, b, a)" is used instead (with alpha normalized to [0, 1]). pub fn html(&self) -> String { if self.a() == 255 { format!("#{:02x}{:02x}{:02x}", self.r(), self.g(), self.b()) @@ -376,9 +376,10 @@ impl FromStr for Rgb8 { } // named color else { - if let Some(col) = css4::lookup_name(raw) { - Ok(col.rgb()) - } else if let Some(col) = xkcd::lookup_name(raw) { + if let Some(col) = names::lookup(raw) { + if col.a() != 255 { + return Err(ParseError::InvalidAlphaComponent); + } Ok(col.rgb()) } else { Err(ParseError::UnknownName) @@ -441,9 +442,7 @@ impl FromStr for Rgba8 { } // named color else { - if let Some(col) = css4::lookup_name(raw) { - Ok(col) - } else if let Some(col) = xkcd::lookup_name(raw) { + if let Some(col) = names::lookup(raw) { Ok(col) } else { Err(ParseError::UnknownName) @@ -452,6 +451,27 @@ impl FromStr for Rgba8 { } } +pub(crate) mod names { + use std::collections::HashMap; + use std::sync::LazyLock; + + use crate::Rgba8; + use crate::color::{css4, xkcd}; + + static MAP: LazyLock> = LazyLock::new(|| { + // Start with XKCD colors, then CSS4 so CSS4 names take precedence on collisions. + let mut map = HashMap::with_capacity(xkcd::COLORS.len() + css4::COLORS.len()); + map.extend(xkcd::COLORS.iter().map(|(name, rgba)| (*name, *rgba))); + map.extend(css4::COLORS.iter().map(|(name, rgba)| (*name, *rgba))); + map + }); + + pub(crate) fn lookup(name: &str) -> Option { + let key = name.trim().to_lowercase(); + MAP.get(key.as_str()).copied() + } +} + /// A trait for interpolating between two colors, used for color scales in heatmaps and similar plots. pub trait Lerp { /// Interpolate between two colors using a parameter t in the range [0.0, 1.0]. diff --git a/base/src/color/css4.rs b/base/src/color/css4.rs index 4ed312ea..27c9afa3 100644 --- a/base/src/color/css4.rs +++ b/base/src/color/css4.rs @@ -1,6 +1,159 @@ use super::Rgba8; // standard CSS colors +pub const COLORS: &[(&str, Rgba8)] = &[ + ("transparent", Rgba8::new(0, 0, 0, 0)), + ("black", Rgba8::from_hex(b"#000000")), + ("silver", Rgba8::from_hex(b"#c0c0c0")), + ("gray", Rgba8::from_hex(b"#808080")), + ("white", Rgba8::from_hex(b"#ffffff")), + ("maroon", Rgba8::from_hex(b"#800000")), + ("red", Rgba8::from_hex(b"#ff0000")), + ("purple", Rgba8::from_hex(b"#800080")), + ("fuchsia", Rgba8::from_hex(b"#ff00ff")), + ("green", Rgba8::from_hex(b"#008000")), + ("lime", Rgba8::from_hex(b"#00ff00")), + ("olive", Rgba8::from_hex(b"#808000")), + ("yellow", Rgba8::from_hex(b"#ffff00")), + ("navy", Rgba8::from_hex(b"#000080")), + ("blue", Rgba8::from_hex(b"#0000ff")), + ("teal", Rgba8::from_hex(b"#008080")), + ("aqua", Rgba8::from_hex(b"#00ffff")), + // other named colors + ("aliceblue", Rgba8::from_hex(b"#f0f8ff")), + ("antiquewhite", Rgba8::from_hex(b"#faebd7")), + ("aquamarine", Rgba8::from_hex(b"#7fffd4")), + ("azure", Rgba8::from_hex(b"#f0ffff")), + ("beige", Rgba8::from_hex(b"#f5f5dc")), + ("bisque", Rgba8::from_hex(b"#ffe4c4")), + ("blanchedalmond", Rgba8::from_hex(b"#ffebcd")), + ("blueviolet", Rgba8::from_hex(b"#8a2be2")), + ("brown", Rgba8::from_hex(b"#a52a2a")), + ("burlywood", Rgba8::from_hex(b"#deb887")), + ("cadetblue", Rgba8::from_hex(b"#5f9ea0")), + ("chartreuse", Rgba8::from_hex(b"#7fff00")), + ("chocolate", Rgba8::from_hex(b"#d2691e")), + ("coral", Rgba8::from_hex(b"#ff7f50")), + ("cornflowerblue", Rgba8::from_hex(b"#6495ed")), + ("cornsilk", Rgba8::from_hex(b"#fff8dc")), + ("crimson", Rgba8::from_hex(b"#dc143c")), + ("cyan", Rgba8::from_hex(b"#00ffff")), + ("darkblue", Rgba8::from_hex(b"#00008b")), + ("darkcyan", Rgba8::from_hex(b"#008b8b")), + ("darkgoldenrod", Rgba8::from_hex(b"#b8860b")), + ("darkgray", Rgba8::from_hex(b"#a9a9a9")), + ("darkgreen", Rgba8::from_hex(b"#006400")), + ("darkgrey", Rgba8::from_hex(b"#a9a9a9")), + ("darkkhaki", Rgba8::from_hex(b"#bdb76b")), + ("darkmagenta", Rgba8::from_hex(b"#8b008b")), + ("darkolivegreen", Rgba8::from_hex(b"#556b2f")), + ("darkorange", Rgba8::from_hex(b"#ff8c00")), + ("darkorchid", Rgba8::from_hex(b"#9932cc")), + ("darkred", Rgba8::from_hex(b"#8b0000")), + ("darksalmon", Rgba8::from_hex(b"#e9967a")), + ("darkseagreen", Rgba8::from_hex(b"#8fbc8f")), + ("darkslateblue", Rgba8::from_hex(b"#483d8b")), + ("darkslategray", Rgba8::from_hex(b"#2f4f4f")), + ("darkslategrey", Rgba8::from_hex(b"#2f4f4f")), + ("darkturquoise", Rgba8::from_hex(b"#00ced1")), + ("darkviolet", Rgba8::from_hex(b"#9400d3")), + ("deeppink", Rgba8::from_hex(b"#ff1493")), + ("deepskyblue", Rgba8::from_hex(b"#00bfff")), + ("dimgray", Rgba8::from_hex(b"#696969")), + ("dimgrey", Rgba8::from_hex(b"#696969")), + ("dodgerblue", Rgba8::from_hex(b"#1e90ff")), + ("firebrick", Rgba8::from_hex(b"#b22222")), + ("floralwhite", Rgba8::from_hex(b"#fffaf0")), + ("forestgreen", Rgba8::from_hex(b"#228b22")), + ("gainsboro", Rgba8::from_hex(b"#dcdcdc")), + ("ghostwhite", Rgba8::from_hex(b"#f8f8ff")), + ("gold", Rgba8::from_hex(b"#ffd700")), + ("goldenrod", Rgba8::from_hex(b"#daa520")), + ("greenyellow", Rgba8::from_hex(b"#adff2f")), + ("grey", Rgba8::from_hex(b"#808080")), + ("honeydew", Rgba8::from_hex(b"#f0fff0")), + ("hotpink", Rgba8::from_hex(b"#ff69b4")), + ("indianred", Rgba8::from_hex(b"#cd5c5c")), + ("indigo", Rgba8::from_hex(b"#4b0082")), + ("ivory", Rgba8::from_hex(b"#fffff0")), + ("khaki", Rgba8::from_hex(b"#f0e68c")), + ("lavender", Rgba8::from_hex(b"#e6e6fa")), + ("lavenderblush", Rgba8::from_hex(b"#fff0f5")), + ("lawngreen", Rgba8::from_hex(b"#7cfc00")), + ("lemonchiffon", Rgba8::from_hex(b"#fffacd")), + ("lightblue", Rgba8::from_hex(b"#add8e6")), + ("lightcoral", Rgba8::from_hex(b"#f08080")), + ("lightcyan", Rgba8::from_hex(b"#e0ffff")), + ("lightgoldenrodyellow", Rgba8::from_hex(b"#fafad2")), + ("lightgray", Rgba8::from_hex(b"#d3d3d3")), + ("lightgreen", Rgba8::from_hex(b"#90ee90")), + ("lightgrey", Rgba8::from_hex(b"#d3d3d3")), + ("lightpink", Rgba8::from_hex(b"#ffb6c1")), + ("lightsalmon", Rgba8::from_hex(b"#ffa07a")), + ("lightseagreen", Rgba8::from_hex(b"#20b2aa")), + ("lightskyblue", Rgba8::from_hex(b"#87cefa")), + ("lightslategray", Rgba8::from_hex(b"#778899")), + ("lightslategrey", Rgba8::from_hex(b"#778899")), + ("lightsteelblue", Rgba8::from_hex(b"#b0c4de")), + ("lightyellow", Rgba8::from_hex(b"#ffffe0")), + ("limegreen", Rgba8::from_hex(b"#32cd32")), + ("linen", Rgba8::from_hex(b"#faf0e6")), + ("magenta", Rgba8::from_hex(b"#ff00ff")), + ("mediumaquamarine", Rgba8::from_hex(b"#66cdaa")), + ("mediumblue", Rgba8::from_hex(b"#0000cd")), + ("mediumorchid", Rgba8::from_hex(b"#ba55d3")), + ("mediumpurple", Rgba8::from_hex(b"#9370db")), + ("mediumseagreen", Rgba8::from_hex(b"#3cb371")), + ("mediumslateblue", Rgba8::from_hex(b"#7b68ee")), + ("mediumspringgreen", Rgba8::from_hex(b"#00fa9a")), + ("mediumturquoise", Rgba8::from_hex(b"#48d1cc")), + ("mediumvioletred", Rgba8::from_hex(b"#c71585")), + ("midnightblue", Rgba8::from_hex(b"#191970")), + ("mintcream", Rgba8::from_hex(b"#f5fffa")), + ("mistyrose", Rgba8::from_hex(b"#ffe4e1")), + ("moccasin", Rgba8::from_hex(b"#ffe4b5")), + ("navajowhite", Rgba8::from_hex(b"#ffdead")), + ("oldlace", Rgba8::from_hex(b"#fdf5e6")), + ("olivedrab", Rgba8::from_hex(b"#6b8e23")), + ("orange", Rgba8::from_hex(b"#ffa500")), + ("orangered", Rgba8::from_hex(b"#ff4500")), + ("orchid", Rgba8::from_hex(b"#da70d6")), + ("palegoldenrod", Rgba8::from_hex(b"#eee8aa")), + ("palegreen", Rgba8::from_hex(b"#98fb98")), + ("paleturquoise", Rgba8::from_hex(b"#afeeee")), + ("palevioletred", Rgba8::from_hex(b"#db7093")), + ("papayawhip", Rgba8::from_hex(b"#ffefd5")), + ("peachpuff", Rgba8::from_hex(b"#ffdab9")), + ("peru", Rgba8::from_hex(b"#cd853f")), + ("pink", Rgba8::from_hex(b"#ffc0cb")), + ("plum", Rgba8::from_hex(b"#dda0dd")), + ("powderblue", Rgba8::from_hex(b"#b0e0e6")), + ("rebeccapurple", Rgba8::from_hex(b"#663399")), + ("rosybrown", Rgba8::from_hex(b"#bc8f8f")), + ("royalblue", Rgba8::from_hex(b"#4169e1")), + ("saddlebrown", Rgba8::from_hex(b"#8b4513")), + ("salmon", Rgba8::from_hex(b"#fa8072")), + ("sandybrown", Rgba8::from_hex(b"#f4a460")), + ("seagreen", Rgba8::from_hex(b"#2e8b57")), + ("seashell", Rgba8::from_hex(b"#fff5ee")), + ("sienna", Rgba8::from_hex(b"#a0522d")), + ("skyblue", Rgba8::from_hex(b"#87ceeb")), + ("slateblue", Rgba8::from_hex(b"#6a5acd")), + ("slategray", Rgba8::from_hex(b"#708090")), + ("slategrey", Rgba8::from_hex(b"#708090")), + ("snow", Rgba8::from_hex(b"#fffafa")), + ("springgreen", Rgba8::from_hex(b"#00ff7f")), + ("steelblue", Rgba8::from_hex(b"#4682b4")), + ("tan", Rgba8::from_hex(b"#d2b48c")), + ("thistle", Rgba8::from_hex(b"#d8bfd8")), + ("tomato", Rgba8::from_hex(b"#ff6347")), + ("turquoise", Rgba8::from_hex(b"#40e0d0")), + ("violet", Rgba8::from_hex(b"#ee82ee")), + ("wheat", Rgba8::from_hex(b"#f5deb3")), + ("whitesmoke", Rgba8::from_hex(b"#f5f5f5")), + ("yellowgreen", Rgba8::from_hex(b"#9acd32")), +]; + ///
pub const TRANSPARENT: Rgba8 = Rgba8::new(0, 0, 0, 0); @@ -302,162 +455,3 @@ pub const WHEAT: Rgba8 = Rgba8::from_hex(b"#f5deb3"); pub const WHITESMOKE: Rgba8 = Rgba8::from_hex(b"#f5f5f5"); ///
pub const YELLOWGREEN: Rgba8 = Rgba8::from_hex(b"#9acd32"); - -/// Lookup a named color (case-insensitive). -/// Return Some(Rgba8) if the name is known -pub(super) fn lookup_name(name: &str) -> Option { - match name.trim().to_ascii_lowercase().as_str() { - "transparent" => Some(TRANSPARENT), - - "black" => Some(BLACK), - "silver" => Some(SILVER), - "gray" | "grey" => Some(GRAY), - "white" => Some(WHITE), - "maroon" => Some(MAROON), - "red" => Some(RED), - "purple" => Some(PURPLE), - "fuchsia" => Some(FUCHSIA), - "green" => Some(GREEN), - "lime" => Some(LIME), - "olive" => Some(OLIVE), - "yellow" => Some(YELLOW), - "navy" => Some(NAVY), - "blue" => Some(BLUE), - "teal" => Some(TEAL), - "aqua" | "cyan" => Some(AQUA), - - "aliceblue" => Some(ALICEBLUE), - "antiquewhite" => Some(ANTIQUEWHITE), - "aquamarine" => Some(AQUAMARINE), - "azure" => Some(AZURE), - "beige" => Some(BEIGE), - "bisque" => Some(BISQUE), - "blanchedalmond" => Some(BLANCHEDALMOND), - "blueviolet" => Some(BLUEVIOLET), - "brown" => Some(BROWN), - "burlywood" => Some(BURLYWOOD), - "cadetblue" => Some(CADETBLUE), - "chartreuse" => Some(CHARTREUSE), - "chocolate" => Some(CHOCOLATE), - "coral" => Some(CORAL), - "cornflowerblue" => Some(CORNFLOWERBLUE), - "cornsilk" => Some(CORNSILK), - "crimson" => Some(CRIMSON), - "darkblue" => Some(DARKBLUE), - "darkcyan" => Some(DARKCYAN), - "darkgoldenrod" => Some(DARKGOLDENROD), - "darkgray" => Some(DARKGRAY), - "darkgreen" => Some(DARKGREEN), - "darkgrey" => Some(DARKGREY), - "darkkhaki" => Some(DARKKHAKI), - "darkmagenta" => Some(DARKMAGENTA), - "darkolivegreen" => Some(DARKOLIVEGREEN), - "darkorange" => Some(DARKORANGE), - "darkorchid" => Some(DARKORCHID), - "darkred" => Some(DARKRED), - "darksalmon" => Some(DARKSALMON), - "darkseagreen" => Some(DARKSEAGREEN), - "darkslateblue" => Some(DARKSLATEBLUE), - "darkslategray" => Some(DARKSLATEGRAY), - "darkslategrey" => Some(DARKSLATEGREY), - "darkturquoise" => Some(DARKTURQUOISE), - "darkviolet" => Some(DARKVIOLET), - "deeppink" => Some(DEEPPINK), - "deepskyblue" => Some(DEEPSKYBLUE), - "dimgray" => Some(DIMGRAY), - "dimgrey" => Some(DIMGREY), - "dodgerblue" => Some(DODGERBLUE), - "firebrick" => Some(FIREBRICK), - "floralwhite" => Some(FLORALWHITE), - "forestgreen" => Some(FORESTGREEN), - "gainsboro" => Some(GAINSBORO), - "ghostwhite" => Some(GHOSTWHITE), - "gold" => Some(GOLD), - "goldenrod" => Some(GOLDENROD), - "greenyellow" => Some(GREENYELLOW), - "honeydew" => Some(HONEYDEW), - "hotpink" => Some(HOTPINK), - "indianred" => Some(INDIANRED), - "indigo" => Some(INDIGO), - "ivory" => Some(IVORY), - "khaki" => Some(KHAKI), - "lavender" => Some(LAVENDER), - "lavenderblush" => Some(LAVENDERBLUSH), - "lawngreen" => Some(LAWNGREEN), - "lemonchiffon" => Some(LEMONCHIFFON), - "lightblue" => Some(LIGHTBLUE), - "lightcoral" => Some(LIGHTCORAL), - "lightcyan" => Some(LIGHTCYAN), - "lightgoldenrodyellow" => Some(LIGHTGOLDENRODYELLOW), - "lightgray" => Some(LIGHTGRAY), - "lightgreen" => Some(LIGHTGREEN), - "lightgrey" => Some(LIGHTGREY), - "lightpink" => Some(LIGHTPINK), - "lightsalmon" => Some(LIGHTSALMON), - "lightseagreen" => Some(LIGHTSEAGREEN), - "lightskyblue" => Some(LIGHTSKYBLUE), - "lightslategray" => Some(LIGHTSLATEGRAY), - "lightslategrey" => Some(LIGHTSLATEGREY), - "lightsteelblue" => Some(LIGHTSTEELBLUE), - "lightyellow" => Some(LIGHTYELLOW), - "limegreen" => Some(LIMEGREEN), - "linen" => Some(LINEN), - - "magenta" => Some(MAGENTA), - "mediumaquamarine" => Some(MEDIUMAQUAMARINE), - "mediumblue" => Some(MEDIUMBLUE), - "mediumorchid" => Some(MEDIUMORCHID), - "mediumpurple" => Some(MEDIUMPURPLE), - "mediumseagreen" => Some(MEDIUMSEAGREEN), - "mediumslateblue" => Some(MEDIUMSLATEBLUE), - "mediumspringgreen" => Some(MEDIUMSPRINGGREEN), - "mediumturquoise" => Some(MEDIUMTURQUOISE), - "mediumvioletred" => Some(MEDIUMVIOLETRED), - "midnightblue" => Some(MIDNIGHTBLUE), - "mintcream" => Some(MINTCREAM), - "mistyrose" => Some(MISTYROSE), - "moccasin" => Some(MOCCASIN), - "navajowhite" => Some(NAVAJOWHITE), - "oldlace" => Some(OLDLACE), - "olivedrab" => Some(OLIVEDRAB), - "orange" => Some(ORANGE), - "orangered" => Some(ORANGERED), - "orchid" => Some(ORCHID), - "palegoldenrod" => Some(PALEGOLDENROD), - "palegreen" => Some(PALEGREEN), - "paleturquoise" => Some(PALETURQUOISE), - "palevioletred" => Some(PALEVIOLETRED), - "papayawhip" => Some(PAPAYAWHIP), - "peachpuff" => Some(PEACHPUFF), - "peru" => Some(PERU), - "pink" => Some(PINK), - "plum" => Some(PLUM), - "powderblue" => Some(POWDERBLUE), - "rebeccapurple" => Some(REBECCAPURPLE), - "rosybrown" => Some(ROSYBROWN), - "royalblue" => Some(ROYALBLUE), - "saddlebrown" => Some(SADDLEBROWN), - "salmon" => Some(SALMON), - "sandybrown" => Some(SANDYBROWN), - "seagreen" => Some(SEAGREEN), - "seashell" => Some(SEASHELL), - "sienna" => Some(SIENNA), - "skyblue" => Some(SKYBLUE), - "slateblue" => Some(SLATEBLUE), - "slategray" => Some(SLATEGRAY), - "slategrey" => Some(SLATEGREY), - "snow" => Some(SNOW), - "springgreen" => Some(SPRINGGREEN), - "steelblue" => Some(STEELBLUE), - "tan" => Some(TAN), - "thistle" => Some(THISTLE), - "tomato" => Some(TOMATO), - "turquoise" => Some(TURQUOISE), - "violet" => Some(VIOLET), - "wheat" => Some(WHEAT), - "whitesmoke" => Some(WHITESMOKE), - "yellowgreen" => Some(YELLOWGREEN), - - _ => None, - } -} diff --git a/base/src/color/xkcd.rs b/base/src/color/xkcd.rs index db2270b2..a0a4e426 100644 --- a/base/src/color/xkcd.rs +++ b/base/src/color/xkcd.rs @@ -1,961 +1,908 @@ use super::Rgba8; -/// Colors from the xkcd color survey. +/// Colors from the xkcd color survey, minus the colors that are present in the CSS4 color set. /// These are not intended to be used directly, but are available for users who want to use them. /// https://blog.xkcd.com/2010/05/03/color-survey-results/ -pub fn lookup_name(name: &str) -> Option { - // License: https://creativecommons.org/publicdomain/zero/1.0/ - match name { - "cloudy blue" => Some(Rgba8::from_hex(b"#acc2d9")), - "dark pastel green" => Some(Rgba8::from_hex(b"#56ae57")), - "dust" => Some(Rgba8::from_hex(b"#b2996e")), - "electric lime" => Some(Rgba8::from_hex(b"#a8ff04")), - "fresh green" => Some(Rgba8::from_hex(b"#69d84f")), - "light eggplant" => Some(Rgba8::from_hex(b"#894585")), - "nasty green" => Some(Rgba8::from_hex(b"#70b23f")), - "really light blue" => Some(Rgba8::from_hex(b"#d4ffff")), - "tea" => Some(Rgba8::from_hex(b"#65ab7c")), - "warm purple" => Some(Rgba8::from_hex(b"#952e8f")), - "yellowish tan" => Some(Rgba8::from_hex(b"#fcfc81")), - "cement" => Some(Rgba8::from_hex(b"#a5a391")), - "dark grass green" => Some(Rgba8::from_hex(b"#388004")), - "dusty teal" => Some(Rgba8::from_hex(b"#4c9085")), - "grey teal" => Some(Rgba8::from_hex(b"#5e9b8a")), - "macaroni and cheese" => Some(Rgba8::from_hex(b"#efb435")), - "pinkish tan" => Some(Rgba8::from_hex(b"#d99b82")), - "spruce" => Some(Rgba8::from_hex(b"#0a5f38")), - "strong blue" => Some(Rgba8::from_hex(b"#0c06f7")), - "toxic green" => Some(Rgba8::from_hex(b"#61de2a")), - "windows blue" => Some(Rgba8::from_hex(b"#3778bf")), - "blue blue" => Some(Rgba8::from_hex(b"#2242c7")), - "blue with a hint of purple" => Some(Rgba8::from_hex(b"#533cc6")), - "booger" => Some(Rgba8::from_hex(b"#9bb53c")), - "bright sea green" => Some(Rgba8::from_hex(b"#05ffa6")), - "dark green blue" => Some(Rgba8::from_hex(b"#1f6357")), - "deep turquoise" => Some(Rgba8::from_hex(b"#017374")), - "green teal" => Some(Rgba8::from_hex(b"#0cb577")), - "strong pink" => Some(Rgba8::from_hex(b"#ff0789")), - "bland" => Some(Rgba8::from_hex(b"#afa88b")), - "deep aqua" => Some(Rgba8::from_hex(b"#08787f")), - "lavender pink" => Some(Rgba8::from_hex(b"#dd85d7")), - "light moss green" => Some(Rgba8::from_hex(b"#a6c875")), - "light seafoam green" => Some(Rgba8::from_hex(b"#a7ffb5")), - "olive yellow" => Some(Rgba8::from_hex(b"#c2b709")), - "pig pink" => Some(Rgba8::from_hex(b"#e78ea5")), - "deep lilac" => Some(Rgba8::from_hex(b"#966ebd")), - "desert" => Some(Rgba8::from_hex(b"#ccad60")), - "dusty lavender" => Some(Rgba8::from_hex(b"#ac86a8")), - "purpley grey" => Some(Rgba8::from_hex(b"#947e94")), - "purply" => Some(Rgba8::from_hex(b"#983fb2")), - "candy pink" => Some(Rgba8::from_hex(b"#ff63e9")), - "light pastel green" => Some(Rgba8::from_hex(b"#b2fba5")), - "boring green" => Some(Rgba8::from_hex(b"#63b365")), - "kiwi green" => Some(Rgba8::from_hex(b"#8ee53f")), - "light grey green" => Some(Rgba8::from_hex(b"#b7e1a1")), - "orange pink" => Some(Rgba8::from_hex(b"#ff6f52")), - "tea green" => Some(Rgba8::from_hex(b"#bdf8a3")), - "very light brown" => Some(Rgba8::from_hex(b"#d3b683")), - "egg shell" => Some(Rgba8::from_hex(b"#fffcc4")), - "eggplant purple" => Some(Rgba8::from_hex(b"#430541")), - "powder pink" => Some(Rgba8::from_hex(b"#ffb2d0")), - "reddish grey" => Some(Rgba8::from_hex(b"#997570")), - "baby shit brown" => Some(Rgba8::from_hex(b"#ad900d")), - "liliac" => Some(Rgba8::from_hex(b"#c48efd")), - "stormy blue" => Some(Rgba8::from_hex(b"#507b9c")), - "ugly brown" => Some(Rgba8::from_hex(b"#7d7103")), - "custard" => Some(Rgba8::from_hex(b"#fffd78")), - "darkish pink" => Some(Rgba8::from_hex(b"#da467d")), - "deep brown" => Some(Rgba8::from_hex(b"#410200")), - "greenish beige" => Some(Rgba8::from_hex(b"#c9d179")), - "manilla" => Some(Rgba8::from_hex(b"#fffa86")), - "off blue" => Some(Rgba8::from_hex(b"#5684ae")), - "battleship grey" => Some(Rgba8::from_hex(b"#6b7c85")), - "browny green" => Some(Rgba8::from_hex(b"#6f6c0a")), - "bruise" => Some(Rgba8::from_hex(b"#7e4071")), - "kelley green" => Some(Rgba8::from_hex(b"#009337")), - "sickly yellow" => Some(Rgba8::from_hex(b"#d0e429")), - "sunny yellow" => Some(Rgba8::from_hex(b"#fff917")), - "azul" => Some(Rgba8::from_hex(b"#1d5dec")), - "darkgreen" => Some(Rgba8::from_hex(b"#054907")), - "green/yellow" => Some(Rgba8::from_hex(b"#b5ce08")), - "lichen" => Some(Rgba8::from_hex(b"#8fb67b")), - "light light green" => Some(Rgba8::from_hex(b"#c8ffb0")), - "pale gold" => Some(Rgba8::from_hex(b"#fdde6c")), - "sun yellow" => Some(Rgba8::from_hex(b"#ffdf22")), - "tan green" => Some(Rgba8::from_hex(b"#a9be70")), - "burple" => Some(Rgba8::from_hex(b"#6832e3")), - "butterscotch" => Some(Rgba8::from_hex(b"#fdb147")), - "toupe" => Some(Rgba8::from_hex(b"#c7ac7d")), - "dark cream" => Some(Rgba8::from_hex(b"#fff39a")), - "indian red" => Some(Rgba8::from_hex(b"#850e04")), - "light lavendar" => Some(Rgba8::from_hex(b"#efc0fe")), - "poison green" => Some(Rgba8::from_hex(b"#40fd14")), - "baby puke green" => Some(Rgba8::from_hex(b"#b6c406")), - "bright yellow green" => Some(Rgba8::from_hex(b"#9dff00")), - "charcoal grey" => Some(Rgba8::from_hex(b"#3c4142")), - "squash" => Some(Rgba8::from_hex(b"#f2ab15")), - "cinnamon" => Some(Rgba8::from_hex(b"#ac4f06")), - "light pea green" => Some(Rgba8::from_hex(b"#c4fe82")), - "radioactive green" => Some(Rgba8::from_hex(b"#2cfa1f")), - "raw sienna" => Some(Rgba8::from_hex(b"#9a6200")), - "baby purple" => Some(Rgba8::from_hex(b"#ca9bf7")), - "cocoa" => Some(Rgba8::from_hex(b"#875f42")), - "light royal blue" => Some(Rgba8::from_hex(b"#3a2efe")), - "orangeish" => Some(Rgba8::from_hex(b"#fd8d49")), - "rust brown" => Some(Rgba8::from_hex(b"#8b3103")), - "sand brown" => Some(Rgba8::from_hex(b"#cba560")), - "swamp" => Some(Rgba8::from_hex(b"#698339")), - "tealish green" => Some(Rgba8::from_hex(b"#0cdc73")), - "burnt siena" => Some(Rgba8::from_hex(b"#b75203")), - "camo" => Some(Rgba8::from_hex(b"#7f8f4e")), - "dusk blue" => Some(Rgba8::from_hex(b"#26538d")), - "fern" => Some(Rgba8::from_hex(b"#63a950")), - "old rose" => Some(Rgba8::from_hex(b"#c87f89")), - "pale light green" => Some(Rgba8::from_hex(b"#b1fc99")), - "peachy pink" => Some(Rgba8::from_hex(b"#ff9a8a")), - "rosy pink" => Some(Rgba8::from_hex(b"#f6688e")), - "light bluish green" => Some(Rgba8::from_hex(b"#76fda8")), - "light bright green" => Some(Rgba8::from_hex(b"#53fe5c")), - "light neon green" => Some(Rgba8::from_hex(b"#4efd54")), - "light seafoam" => Some(Rgba8::from_hex(b"#a0febf")), - "tiffany blue" => Some(Rgba8::from_hex(b"#7bf2da")), - "washed out green" => Some(Rgba8::from_hex(b"#bcf5a6")), - "browny orange" => Some(Rgba8::from_hex(b"#ca6b02")), - "nice blue" => Some(Rgba8::from_hex(b"#107ab0")), - "sapphire" => Some(Rgba8::from_hex(b"#2138ab")), - "greyish teal" => Some(Rgba8::from_hex(b"#719f91")), - "orangey yellow" => Some(Rgba8::from_hex(b"#fdb915")), - "parchment" => Some(Rgba8::from_hex(b"#fefcaf")), - "straw" => Some(Rgba8::from_hex(b"#fcf679")), - "very dark brown" => Some(Rgba8::from_hex(b"#1d0200")), - "terracota" => Some(Rgba8::from_hex(b"#cb6843")), - "ugly blue" => Some(Rgba8::from_hex(b"#31668a")), - "clear blue" => Some(Rgba8::from_hex(b"#247afd")), - "creme" => Some(Rgba8::from_hex(b"#ffffb6")), - "foam green" => Some(Rgba8::from_hex(b"#90fda9")), - "grey/green" => Some(Rgba8::from_hex(b"#86a17d")), - "light gold" => Some(Rgba8::from_hex(b"#fddc5c")), - "seafoam blue" => Some(Rgba8::from_hex(b"#78d1b6")), - "topaz" => Some(Rgba8::from_hex(b"#13bbaf")), - "violet pink" => Some(Rgba8::from_hex(b"#fb5ffc")), - "wintergreen" => Some(Rgba8::from_hex(b"#20f986")), - "yellow tan" => Some(Rgba8::from_hex(b"#ffe36e")), - "dark fuchsia" => Some(Rgba8::from_hex(b"#9d0759")), - "indigo blue" => Some(Rgba8::from_hex(b"#3a18b1")), - "light yellowish green" => Some(Rgba8::from_hex(b"#c2ff89")), - "pale magenta" => Some(Rgba8::from_hex(b"#d767ad")), - "rich purple" => Some(Rgba8::from_hex(b"#720058")), - "sunflower yellow" => Some(Rgba8::from_hex(b"#ffda03")), - "green/blue" => Some(Rgba8::from_hex(b"#01c08d")), - "leather" => Some(Rgba8::from_hex(b"#ac7434")), - "racing green" => Some(Rgba8::from_hex(b"#014600")), - "vivid purple" => Some(Rgba8::from_hex(b"#9900fa")), - "dark royal blue" => Some(Rgba8::from_hex(b"#02066f")), - "hazel" => Some(Rgba8::from_hex(b"#8e7618")), - "muted pink" => Some(Rgba8::from_hex(b"#d1768f")), - "booger green" => Some(Rgba8::from_hex(b"#96b403")), - "canary" => Some(Rgba8::from_hex(b"#fdff63")), - "cool grey" => Some(Rgba8::from_hex(b"#95a3a6")), - "dark taupe" => Some(Rgba8::from_hex(b"#7f684e")), - "darkish purple" => Some(Rgba8::from_hex(b"#751973")), - "true green" => Some(Rgba8::from_hex(b"#089404")), - "coral pink" => Some(Rgba8::from_hex(b"#ff6163")), - "dark sage" => Some(Rgba8::from_hex(b"#598556")), - "dark slate blue" => Some(Rgba8::from_hex(b"#214761")), - "flat blue" => Some(Rgba8::from_hex(b"#3c73a8")), - "mushroom" => Some(Rgba8::from_hex(b"#ba9e88")), - "rich blue" => Some(Rgba8::from_hex(b"#021bf9")), - "dirty purple" => Some(Rgba8::from_hex(b"#734a65")), - "greenblue" => Some(Rgba8::from_hex(b"#23c48b")), - "icky green" => Some(Rgba8::from_hex(b"#8fae22")), - "light khaki" => Some(Rgba8::from_hex(b"#e6f2a2")), - "warm blue" => Some(Rgba8::from_hex(b"#4b57db")), - "dark hot pink" => Some(Rgba8::from_hex(b"#d90166")), - "deep sea blue" => Some(Rgba8::from_hex(b"#015482")), - "carmine" => Some(Rgba8::from_hex(b"#9d0216")), - "dark yellow green" => Some(Rgba8::from_hex(b"#728f02")), - "pale peach" => Some(Rgba8::from_hex(b"#ffe5ad")), - "plum purple" => Some(Rgba8::from_hex(b"#4e0550")), - "golden rod" => Some(Rgba8::from_hex(b"#f9bc08")), - "neon red" => Some(Rgba8::from_hex(b"#ff073a")), - "old pink" => Some(Rgba8::from_hex(b"#c77986")), - "very pale blue" => Some(Rgba8::from_hex(b"#d6fffe")), - "blood orange" => Some(Rgba8::from_hex(b"#fe4b03")), - "grapefruit" => Some(Rgba8::from_hex(b"#fd5956")), - "sand yellow" => Some(Rgba8::from_hex(b"#fce166")), - "clay brown" => Some(Rgba8::from_hex(b"#b2713d")), - "dark blue grey" => Some(Rgba8::from_hex(b"#1f3b4d")), - "flat green" => Some(Rgba8::from_hex(b"#699d4c")), - "light green blue" => Some(Rgba8::from_hex(b"#56fca2")), - "warm pink" => Some(Rgba8::from_hex(b"#fb5581")), - "dodger blue" => Some(Rgba8::from_hex(b"#3e82fc")), - "gross green" => Some(Rgba8::from_hex(b"#a0bf16")), - "ice" => Some(Rgba8::from_hex(b"#d6fffa")), - "metallic blue" => Some(Rgba8::from_hex(b"#4f738e")), - "pale salmon" => Some(Rgba8::from_hex(b"#ffb19a")), - "sap green" => Some(Rgba8::from_hex(b"#5c8b15")), - "algae" => Some(Rgba8::from_hex(b"#54ac68")), - "bluey grey" => Some(Rgba8::from_hex(b"#89a0b0")), - "greeny grey" => Some(Rgba8::from_hex(b"#7ea07a")), - "highlighter green" => Some(Rgba8::from_hex(b"#1bfc06")), - "light light blue" => Some(Rgba8::from_hex(b"#cafffb")), - "light mint" => Some(Rgba8::from_hex(b"#b6ffbb")), - "raw umber" => Some(Rgba8::from_hex(b"#a75e09")), - "vivid blue" => Some(Rgba8::from_hex(b"#152eff")), - "deep lavender" => Some(Rgba8::from_hex(b"#8d5eb7")), - "dull teal" => Some(Rgba8::from_hex(b"#5f9e8f")), - "light greenish blue" => Some(Rgba8::from_hex(b"#63f7b4")), - "mud green" => Some(Rgba8::from_hex(b"#606602")), - "pinky" => Some(Rgba8::from_hex(b"#fc86aa")), - "red wine" => Some(Rgba8::from_hex(b"#8c0034")), - "shit green" => Some(Rgba8::from_hex(b"#758000")), - "tan brown" => Some(Rgba8::from_hex(b"#ab7e4c")), - "darkblue" => Some(Rgba8::from_hex(b"#030764")), - "rosa" => Some(Rgba8::from_hex(b"#fe86a4")), - "lipstick" => Some(Rgba8::from_hex(b"#d5174e")), - "pale mauve" => Some(Rgba8::from_hex(b"#fed0fc")), - "claret" => Some(Rgba8::from_hex(b"#680018")), - "dandelion" => Some(Rgba8::from_hex(b"#fedf08")), - "orangered" => Some(Rgba8::from_hex(b"#fe420f")), - "poop green" => Some(Rgba8::from_hex(b"#6f7c00")), - "ruby" => Some(Rgba8::from_hex(b"#ca0147")), - "dark" => Some(Rgba8::from_hex(b"#1b2431")), - "greenish turquoise" => Some(Rgba8::from_hex(b"#00fbb0")), - "pastel red" => Some(Rgba8::from_hex(b"#db5856")), - "piss yellow" => Some(Rgba8::from_hex(b"#ddd618")), - "bright cyan" => Some(Rgba8::from_hex(b"#41fdfe")), - "dark coral" => Some(Rgba8::from_hex(b"#cf524e")), - "algae green" => Some(Rgba8::from_hex(b"#21c36f")), - "darkish red" => Some(Rgba8::from_hex(b"#a90308")), - "reddy brown" => Some(Rgba8::from_hex(b"#6e1005")), - "blush pink" => Some(Rgba8::from_hex(b"#fe828c")), - "camouflage green" => Some(Rgba8::from_hex(b"#4b6113")), - "lawn green" => Some(Rgba8::from_hex(b"#4da409")), - "putty" => Some(Rgba8::from_hex(b"#beae8a")), - "vibrant blue" => Some(Rgba8::from_hex(b"#0339f8")), - "dark sand" => Some(Rgba8::from_hex(b"#a88f59")), - "purple/blue" => Some(Rgba8::from_hex(b"#5d21d0")), - "saffron" => Some(Rgba8::from_hex(b"#feb209")), - "twilight" => Some(Rgba8::from_hex(b"#4e518b")), - "warm brown" => Some(Rgba8::from_hex(b"#964e02")), - "bluegrey" => Some(Rgba8::from_hex(b"#85a3b2")), - "bubble gum pink" => Some(Rgba8::from_hex(b"#ff69af")), - "duck egg blue" => Some(Rgba8::from_hex(b"#c3fbf4")), - "greenish cyan" => Some(Rgba8::from_hex(b"#2afeb7")), - "petrol" => Some(Rgba8::from_hex(b"#005f6a")), - "royal" => Some(Rgba8::from_hex(b"#0c1793")), - "butter" => Some(Rgba8::from_hex(b"#ffff81")), - "dusty orange" => Some(Rgba8::from_hex(b"#f0833a")), - "off yellow" => Some(Rgba8::from_hex(b"#f1f33f")), - "pale olive green" => Some(Rgba8::from_hex(b"#b1d27b")), - "orangish" => Some(Rgba8::from_hex(b"#fc824a")), - "leaf" => Some(Rgba8::from_hex(b"#71aa34")), - "light blue grey" => Some(Rgba8::from_hex(b"#b7c9e2")), - "dried blood" => Some(Rgba8::from_hex(b"#4b0101")), - "lightish purple" => Some(Rgba8::from_hex(b"#a552e6")), - "rusty red" => Some(Rgba8::from_hex(b"#af2f0d")), - "lavender blue" => Some(Rgba8::from_hex(b"#8b88f8")), - "light grass green" => Some(Rgba8::from_hex(b"#9af764")), - "light mint green" => Some(Rgba8::from_hex(b"#a6fbb2")), - "sunflower" => Some(Rgba8::from_hex(b"#ffc512")), - "velvet" => Some(Rgba8::from_hex(b"#750851")), - "brick orange" => Some(Rgba8::from_hex(b"#c14a09")), - "lightish red" => Some(Rgba8::from_hex(b"#fe2f4a")), - "pure blue" => Some(Rgba8::from_hex(b"#0203e2")), - "twilight blue" => Some(Rgba8::from_hex(b"#0a437a")), - "violet red" => Some(Rgba8::from_hex(b"#a50055")), - "yellowy brown" => Some(Rgba8::from_hex(b"#ae8b0c")), - "carnation" => Some(Rgba8::from_hex(b"#fd798f")), - "muddy yellow" => Some(Rgba8::from_hex(b"#bfac05")), - "dark seafoam green" => Some(Rgba8::from_hex(b"#3eaf76")), - "deep rose" => Some(Rgba8::from_hex(b"#c74767")), - "dusty red" => Some(Rgba8::from_hex(b"#b9484e")), - "grey/blue" => Some(Rgba8::from_hex(b"#647d8e")), - "lemon lime" => Some(Rgba8::from_hex(b"#bffe28")), - "purple/pink" => Some(Rgba8::from_hex(b"#d725de")), - "brown yellow" => Some(Rgba8::from_hex(b"#b29705")), - "purple brown" => Some(Rgba8::from_hex(b"#673a3f")), - "wisteria" => Some(Rgba8::from_hex(b"#a87dc2")), - "banana yellow" => Some(Rgba8::from_hex(b"#fafe4b")), - "lipstick red" => Some(Rgba8::from_hex(b"#c0022f")), - "water blue" => Some(Rgba8::from_hex(b"#0e87cc")), - "brown grey" => Some(Rgba8::from_hex(b"#8d8468")), - "vibrant purple" => Some(Rgba8::from_hex(b"#ad03de")), - "baby green" => Some(Rgba8::from_hex(b"#8cff9e")), - "barf green" => Some(Rgba8::from_hex(b"#94ac02")), - "eggshell blue" => Some(Rgba8::from_hex(b"#c4fff7")), - "sandy yellow" => Some(Rgba8::from_hex(b"#fdee73")), - "cool green" => Some(Rgba8::from_hex(b"#33b864")), - "pale" => Some(Rgba8::from_hex(b"#fff9d0")), - "blue/grey" => Some(Rgba8::from_hex(b"#758da3")), - "hot magenta" => Some(Rgba8::from_hex(b"#f504c9")), - "greyblue" => Some(Rgba8::from_hex(b"#77a1b5")), - "purpley" => Some(Rgba8::from_hex(b"#8756e4")), - "baby shit green" => Some(Rgba8::from_hex(b"#889717")), - "brownish pink" => Some(Rgba8::from_hex(b"#c27e79")), - "dark aquamarine" => Some(Rgba8::from_hex(b"#017371")), - "diarrhea" => Some(Rgba8::from_hex(b"#9f8303")), - "light mustard" => Some(Rgba8::from_hex(b"#f7d560")), - "pale sky blue" => Some(Rgba8::from_hex(b"#bdf6fe")), - "turtle green" => Some(Rgba8::from_hex(b"#75b84f")), - "bright olive" => Some(Rgba8::from_hex(b"#9cbb04")), - "dark grey blue" => Some(Rgba8::from_hex(b"#29465b")), - "greeny brown" => Some(Rgba8::from_hex(b"#696006")), - "lemon green" => Some(Rgba8::from_hex(b"#adf802")), - "light periwinkle" => Some(Rgba8::from_hex(b"#c1c6fc")), - "seaweed green" => Some(Rgba8::from_hex(b"#35ad6b")), - "sunshine yellow" => Some(Rgba8::from_hex(b"#fffd37")), - "ugly purple" => Some(Rgba8::from_hex(b"#a442a0")), - "medium pink" => Some(Rgba8::from_hex(b"#f36196")), - "puke brown" => Some(Rgba8::from_hex(b"#947706")), - "very light pink" => Some(Rgba8::from_hex(b"#fff4f2")), - "viridian" => Some(Rgba8::from_hex(b"#1e9167")), - "bile" => Some(Rgba8::from_hex(b"#b5c306")), - "faded yellow" => Some(Rgba8::from_hex(b"#feff7f")), - "very pale green" => Some(Rgba8::from_hex(b"#cffdbc")), - "vibrant green" => Some(Rgba8::from_hex(b"#0add08")), - "bright lime" => Some(Rgba8::from_hex(b"#87fd05")), - "spearmint" => Some(Rgba8::from_hex(b"#1ef876")), - "light aquamarine" => Some(Rgba8::from_hex(b"#7bfdc7")), - "light sage" => Some(Rgba8::from_hex(b"#bcecac")), - "yellowgreen" => Some(Rgba8::from_hex(b"#bbf90f")), - "baby poo" => Some(Rgba8::from_hex(b"#ab9004")), - "dark seafoam" => Some(Rgba8::from_hex(b"#1fb57a")), - "deep teal" => Some(Rgba8::from_hex(b"#00555a")), - "heather" => Some(Rgba8::from_hex(b"#a484ac")), - "rust orange" => Some(Rgba8::from_hex(b"#c45508")), - "dirty blue" => Some(Rgba8::from_hex(b"#3f829d")), - "fern green" => Some(Rgba8::from_hex(b"#548d44")), - "bright lilac" => Some(Rgba8::from_hex(b"#c95efb")), - "weird green" => Some(Rgba8::from_hex(b"#3ae57f")), - "peacock blue" => Some(Rgba8::from_hex(b"#016795")), - "avocado green" => Some(Rgba8::from_hex(b"#87a922")), - "faded orange" => Some(Rgba8::from_hex(b"#f0944d")), - "grape purple" => Some(Rgba8::from_hex(b"#5d1451")), - "hot green" => Some(Rgba8::from_hex(b"#25ff29")), - "lime yellow" => Some(Rgba8::from_hex(b"#d0fe1d")), - "mango" => Some(Rgba8::from_hex(b"#ffa62b")), - "shamrock" => Some(Rgba8::from_hex(b"#01b44c")), - "bubblegum" => Some(Rgba8::from_hex(b"#ff6cb5")), - "purplish brown" => Some(Rgba8::from_hex(b"#6b4247")), - "vomit yellow" => Some(Rgba8::from_hex(b"#c7c10c")), - "pale cyan" => Some(Rgba8::from_hex(b"#b7fffa")), - "key lime" => Some(Rgba8::from_hex(b"#aeff6e")), - "tomato red" => Some(Rgba8::from_hex(b"#ec2d01")), - "lightgreen" => Some(Rgba8::from_hex(b"#76ff7b")), - "merlot" => Some(Rgba8::from_hex(b"#730039")), - "night blue" => Some(Rgba8::from_hex(b"#040348")), - "purpleish pink" => Some(Rgba8::from_hex(b"#df4ec8")), - "apple" => Some(Rgba8::from_hex(b"#6ecb3c")), - "baby poop green" => Some(Rgba8::from_hex(b"#8f9805")), - "green apple" => Some(Rgba8::from_hex(b"#5edc1f")), - "heliotrope" => Some(Rgba8::from_hex(b"#d94ff5")), - "yellow/green" => Some(Rgba8::from_hex(b"#c8fd3d")), - "almost black" => Some(Rgba8::from_hex(b"#070d0d")), - "cool blue" => Some(Rgba8::from_hex(b"#4984b8")), - "leafy green" => Some(Rgba8::from_hex(b"#51b73b")), - "mustard brown" => Some(Rgba8::from_hex(b"#ac7e04")), - "dusk" => Some(Rgba8::from_hex(b"#4e5481")), - "dull brown" => Some(Rgba8::from_hex(b"#876e4b")), - "frog green" => Some(Rgba8::from_hex(b"#58bc08")), - "vivid green" => Some(Rgba8::from_hex(b"#2fef10")), - "bright light green" => Some(Rgba8::from_hex(b"#2dfe54")), - "fluro green" => Some(Rgba8::from_hex(b"#0aff02")), - "kiwi" => Some(Rgba8::from_hex(b"#9cef43")), - "seaweed" => Some(Rgba8::from_hex(b"#18d17b")), - "navy green" => Some(Rgba8::from_hex(b"#35530a")), - "ultramarine blue" => Some(Rgba8::from_hex(b"#1805db")), - "iris" => Some(Rgba8::from_hex(b"#6258c4")), - "pastel orange" => Some(Rgba8::from_hex(b"#ff964f")), - "yellowish orange" => Some(Rgba8::from_hex(b"#ffab0f")), - "perrywinkle" => Some(Rgba8::from_hex(b"#8f8ce7")), - "tealish" => Some(Rgba8::from_hex(b"#24bca8")), - "dark plum" => Some(Rgba8::from_hex(b"#3f012c")), - "pear" => Some(Rgba8::from_hex(b"#cbf85f")), - "pinkish orange" => Some(Rgba8::from_hex(b"#ff724c")), - "midnight purple" => Some(Rgba8::from_hex(b"#280137")), - "light urple" => Some(Rgba8::from_hex(b"#b36ff6")), - "dark mint" => Some(Rgba8::from_hex(b"#48c072")), - "greenish tan" => Some(Rgba8::from_hex(b"#bccb7a")), - "light burgundy" => Some(Rgba8::from_hex(b"#a8415b")), - "turquoise blue" => Some(Rgba8::from_hex(b"#06b1c4")), - "ugly pink" => Some(Rgba8::from_hex(b"#cd7584")), - "sandy" => Some(Rgba8::from_hex(b"#f1da7a")), - "electric pink" => Some(Rgba8::from_hex(b"#ff0490")), - "muted purple" => Some(Rgba8::from_hex(b"#805b87")), - "mid green" => Some(Rgba8::from_hex(b"#50a747")), - "greyish" => Some(Rgba8::from_hex(b"#a8a495")), - "neon yellow" => Some(Rgba8::from_hex(b"#cfff04")), - "banana" => Some(Rgba8::from_hex(b"#ffff7e")), - "carnation pink" => Some(Rgba8::from_hex(b"#ff7fa7")), - "tomato" => Some(Rgba8::from_hex(b"#ef4026")), - "sea" => Some(Rgba8::from_hex(b"#3c9992")), - "muddy brown" => Some(Rgba8::from_hex(b"#886806")), - "turquoise green" => Some(Rgba8::from_hex(b"#04f489")), - "buff" => Some(Rgba8::from_hex(b"#fef69e")), - "fawn" => Some(Rgba8::from_hex(b"#cfaf7b")), - "muted blue" => Some(Rgba8::from_hex(b"#3b719f")), - "pale rose" => Some(Rgba8::from_hex(b"#fdc1c5")), - "dark mint green" => Some(Rgba8::from_hex(b"#20c073")), - "amethyst" => Some(Rgba8::from_hex(b"#9b5fc0")), - "blue/green" => Some(Rgba8::from_hex(b"#0f9b8e")), - "chestnut" => Some(Rgba8::from_hex(b"#742802")), - "sick green" => Some(Rgba8::from_hex(b"#9db92c")), - "pea" => Some(Rgba8::from_hex(b"#a4bf20")), - "rusty orange" => Some(Rgba8::from_hex(b"#cd5909")), - "stone" => Some(Rgba8::from_hex(b"#ada587")), - "rose red" => Some(Rgba8::from_hex(b"#be013c")), - "pale aqua" => Some(Rgba8::from_hex(b"#b8ffeb")), - "deep orange" => Some(Rgba8::from_hex(b"#dc4d01")), - "earth" => Some(Rgba8::from_hex(b"#a2653e")), - "mossy green" => Some(Rgba8::from_hex(b"#638b27")), - "grassy green" => Some(Rgba8::from_hex(b"#419c03")), - "pale lime green" => Some(Rgba8::from_hex(b"#b1ff65")), - "light grey blue" => Some(Rgba8::from_hex(b"#9dbcd4")), - "pale grey" => Some(Rgba8::from_hex(b"#fdfdfe")), - "asparagus" => Some(Rgba8::from_hex(b"#77ab56")), - "blueberry" => Some(Rgba8::from_hex(b"#464196")), - "purple red" => Some(Rgba8::from_hex(b"#990147")), - "pale lime" => Some(Rgba8::from_hex(b"#befd73")), - "greenish teal" => Some(Rgba8::from_hex(b"#32bf84")), - "caramel" => Some(Rgba8::from_hex(b"#af6f09")), - "deep magenta" => Some(Rgba8::from_hex(b"#a0025c")), - "light peach" => Some(Rgba8::from_hex(b"#ffd8b1")), - "milk chocolate" => Some(Rgba8::from_hex(b"#7f4e1e")), - "ocher" => Some(Rgba8::from_hex(b"#bf9b0c")), - "off green" => Some(Rgba8::from_hex(b"#6ba353")), - "purply pink" => Some(Rgba8::from_hex(b"#f075e6")), - "lightblue" => Some(Rgba8::from_hex(b"#7bc8f6")), - "dusky blue" => Some(Rgba8::from_hex(b"#475f94")), - "golden" => Some(Rgba8::from_hex(b"#f5bf03")), - "light beige" => Some(Rgba8::from_hex(b"#fffeb6")), - "butter yellow" => Some(Rgba8::from_hex(b"#fffd74")), - "dusky purple" => Some(Rgba8::from_hex(b"#895b7b")), - "french blue" => Some(Rgba8::from_hex(b"#436bad")), - "ugly yellow" => Some(Rgba8::from_hex(b"#d0c101")), - "greeny yellow" => Some(Rgba8::from_hex(b"#c6f808")), - "orangish red" => Some(Rgba8::from_hex(b"#f43605")), - "shamrock green" => Some(Rgba8::from_hex(b"#02c14d")), - "orangish brown" => Some(Rgba8::from_hex(b"#b25f03")), - "tree green" => Some(Rgba8::from_hex(b"#2a7e19")), - "deep violet" => Some(Rgba8::from_hex(b"#490648")), - "gunmetal" => Some(Rgba8::from_hex(b"#536267")), - "blue/purple" => Some(Rgba8::from_hex(b"#5a06ef")), - "cherry" => Some(Rgba8::from_hex(b"#cf0234")), - "sandy brown" => Some(Rgba8::from_hex(b"#c4a661")), - "warm grey" => Some(Rgba8::from_hex(b"#978a84")), - "dark indigo" => Some(Rgba8::from_hex(b"#1f0954")), - "midnight" => Some(Rgba8::from_hex(b"#03012d")), - "bluey green" => Some(Rgba8::from_hex(b"#2bb179")), - "grey pink" => Some(Rgba8::from_hex(b"#c3909b")), - "soft purple" => Some(Rgba8::from_hex(b"#a66fb5")), - "blood" => Some(Rgba8::from_hex(b"#770001")), - "brown red" => Some(Rgba8::from_hex(b"#922b05")), - "medium grey" => Some(Rgba8::from_hex(b"#7d7f7c")), - "berry" => Some(Rgba8::from_hex(b"#990f4b")), - "poo" => Some(Rgba8::from_hex(b"#8f7303")), - "purpley pink" => Some(Rgba8::from_hex(b"#c83cb9")), - "light salmon" => Some(Rgba8::from_hex(b"#fea993")), - "snot" => Some(Rgba8::from_hex(b"#acbb0d")), - "easter purple" => Some(Rgba8::from_hex(b"#c071fe")), - "light yellow green" => Some(Rgba8::from_hex(b"#ccfd7f")), - "dark navy blue" => Some(Rgba8::from_hex(b"#00022e")), - "drab" => Some(Rgba8::from_hex(b"#828344")), - "light rose" => Some(Rgba8::from_hex(b"#ffc5cb")), - "rouge" => Some(Rgba8::from_hex(b"#ab1239")), - "purplish red" => Some(Rgba8::from_hex(b"#b0054b")), - "slime green" => Some(Rgba8::from_hex(b"#99cc04")), - "baby poop" => Some(Rgba8::from_hex(b"#937c00")), - "irish green" => Some(Rgba8::from_hex(b"#019529")), - "pink/purple" => Some(Rgba8::from_hex(b"#ef1de7")), - "dark navy" => Some(Rgba8::from_hex(b"#000435")), - "greeny blue" => Some(Rgba8::from_hex(b"#42b395")), - "light plum" => Some(Rgba8::from_hex(b"#9d5783")), - "pinkish grey" => Some(Rgba8::from_hex(b"#c8aca9")), - "dirty orange" => Some(Rgba8::from_hex(b"#c87606")), - "rust red" => Some(Rgba8::from_hex(b"#aa2704")), - "pale lilac" => Some(Rgba8::from_hex(b"#e4cbff")), - "orangey red" => Some(Rgba8::from_hex(b"#fa4224")), - "primary blue" => Some(Rgba8::from_hex(b"#0804f9")), - "kermit green" => Some(Rgba8::from_hex(b"#5cb200")), - "brownish purple" => Some(Rgba8::from_hex(b"#76424e")), - "murky green" => Some(Rgba8::from_hex(b"#6c7a0e")), - "wheat" => Some(Rgba8::from_hex(b"#fbdd7e")), - "very dark purple" => Some(Rgba8::from_hex(b"#2a0134")), - "bottle green" => Some(Rgba8::from_hex(b"#044a05")), - "watermelon" => Some(Rgba8::from_hex(b"#fd4659")), - "deep sky blue" => Some(Rgba8::from_hex(b"#0d75f8")), - "fire engine red" => Some(Rgba8::from_hex(b"#fe0002")), - "yellow ochre" => Some(Rgba8::from_hex(b"#cb9d06")), - "pumpkin orange" => Some(Rgba8::from_hex(b"#fb7d07")), - "pale olive" => Some(Rgba8::from_hex(b"#b9cc81")), - "light lilac" => Some(Rgba8::from_hex(b"#edc8ff")), - "lightish green" => Some(Rgba8::from_hex(b"#61e160")), - "carolina blue" => Some(Rgba8::from_hex(b"#8ab8fe")), - "mulberry" => Some(Rgba8::from_hex(b"#920a4e")), - "shocking pink" => Some(Rgba8::from_hex(b"#fe02a2")), - "auburn" => Some(Rgba8::from_hex(b"#9a3001")), - "bright lime green" => Some(Rgba8::from_hex(b"#65fe08")), - "celadon" => Some(Rgba8::from_hex(b"#befdb7")), - "pinkish brown" => Some(Rgba8::from_hex(b"#b17261")), - "poo brown" => Some(Rgba8::from_hex(b"#885f01")), - "bright sky blue" => Some(Rgba8::from_hex(b"#02ccfe")), - "celery" => Some(Rgba8::from_hex(b"#c1fd95")), - "dirt brown" => Some(Rgba8::from_hex(b"#836539")), - "strawberry" => Some(Rgba8::from_hex(b"#fb2943")), - "dark lime" => Some(Rgba8::from_hex(b"#84b701")), - "copper" => Some(Rgba8::from_hex(b"#b66325")), - "medium brown" => Some(Rgba8::from_hex(b"#7f5112")), - "muted green" => Some(Rgba8::from_hex(b"#5fa052")), - "robin's egg" => Some(Rgba8::from_hex(b"#6dedfd")), - "bright aqua" => Some(Rgba8::from_hex(b"#0bf9ea")), - "bright lavender" => Some(Rgba8::from_hex(b"#c760ff")), - "ivory" => Some(Rgba8::from_hex(b"#ffffcb")), - "very light purple" => Some(Rgba8::from_hex(b"#f6cefc")), - "light navy" => Some(Rgba8::from_hex(b"#155084")), - "pink red" => Some(Rgba8::from_hex(b"#f5054f")), - "olive brown" => Some(Rgba8::from_hex(b"#645403")), - "poop brown" => Some(Rgba8::from_hex(b"#7a5901")), - "mustard green" => Some(Rgba8::from_hex(b"#a8b504")), - "ocean green" => Some(Rgba8::from_hex(b"#3d9973")), - "very dark blue" => Some(Rgba8::from_hex(b"#000133")), - "dusty green" => Some(Rgba8::from_hex(b"#76a973")), - "light navy blue" => Some(Rgba8::from_hex(b"#2e5a88")), - "minty green" => Some(Rgba8::from_hex(b"#0bf77d")), - "adobe" => Some(Rgba8::from_hex(b"#bd6c48")), - "barney" => Some(Rgba8::from_hex(b"#ac1db8")), - "jade green" => Some(Rgba8::from_hex(b"#2baf6a")), - "bright light blue" => Some(Rgba8::from_hex(b"#26f7fd")), - "light lime" => Some(Rgba8::from_hex(b"#aefd6c")), - "dark khaki" => Some(Rgba8::from_hex(b"#9b8f55")), - "orange yellow" => Some(Rgba8::from_hex(b"#ffad01")), - "ocre" => Some(Rgba8::from_hex(b"#c69c04")), - "maize" => Some(Rgba8::from_hex(b"#f4d054")), - "faded pink" => Some(Rgba8::from_hex(b"#de9dac")), - "british racing green" => Some(Rgba8::from_hex(b"#05480d")), - "sandstone" => Some(Rgba8::from_hex(b"#c9ae74")), - "mud brown" => Some(Rgba8::from_hex(b"#60460f")), - "light sea green" => Some(Rgba8::from_hex(b"#98f6b0")), - "robin egg blue" => Some(Rgba8::from_hex(b"#8af1fe")), - "aqua marine" => Some(Rgba8::from_hex(b"#2ee8bb")), - "dark sea green" => Some(Rgba8::from_hex(b"#11875d")), - "soft pink" => Some(Rgba8::from_hex(b"#fdb0c0")), - "orangey brown" => Some(Rgba8::from_hex(b"#b16002")), - "cherry red" => Some(Rgba8::from_hex(b"#f7022a")), - "burnt yellow" => Some(Rgba8::from_hex(b"#d5ab09")), - "brownish grey" => Some(Rgba8::from_hex(b"#86775f")), - "camel" => Some(Rgba8::from_hex(b"#c69f59")), - "purplish grey" => Some(Rgba8::from_hex(b"#7a687f")), - "marine" => Some(Rgba8::from_hex(b"#042e60")), - "greyish pink" => Some(Rgba8::from_hex(b"#c88d94")), - "pale turquoise" => Some(Rgba8::from_hex(b"#a5fbd5")), - "pastel yellow" => Some(Rgba8::from_hex(b"#fffe71")), - "bluey purple" => Some(Rgba8::from_hex(b"#6241c7")), - "canary yellow" => Some(Rgba8::from_hex(b"#fffe40")), - "faded red" => Some(Rgba8::from_hex(b"#d3494e")), - "sepia" => Some(Rgba8::from_hex(b"#985e2b")), - "coffee" => Some(Rgba8::from_hex(b"#a6814c")), - "bright magenta" => Some(Rgba8::from_hex(b"#ff08e8")), - "mocha" => Some(Rgba8::from_hex(b"#9d7651")), - "ecru" => Some(Rgba8::from_hex(b"#feffca")), - "purpleish" => Some(Rgba8::from_hex(b"#98568d")), - "cranberry" => Some(Rgba8::from_hex(b"#9e003a")), - "darkish green" => Some(Rgba8::from_hex(b"#287c37")), - "brown orange" => Some(Rgba8::from_hex(b"#b96902")), - "dusky rose" => Some(Rgba8::from_hex(b"#ba6873")), - "melon" => Some(Rgba8::from_hex(b"#ff7855")), - "sickly green" => Some(Rgba8::from_hex(b"#94b21c")), - "silver" => Some(Rgba8::from_hex(b"#c5c9c7")), - "purply blue" => Some(Rgba8::from_hex(b"#661aee")), - "purpleish blue" => Some(Rgba8::from_hex(b"#6140ef")), - "hospital green" => Some(Rgba8::from_hex(b"#9be5aa")), - "shit brown" => Some(Rgba8::from_hex(b"#7b5804")), - "mid blue" => Some(Rgba8::from_hex(b"#276ab3")), - "amber" => Some(Rgba8::from_hex(b"#feb308")), - "easter green" => Some(Rgba8::from_hex(b"#8cfd7e")), - "soft blue" => Some(Rgba8::from_hex(b"#6488ea")), - "cerulean blue" => Some(Rgba8::from_hex(b"#056eee")), - "golden brown" => Some(Rgba8::from_hex(b"#b27a01")), - "bright turquoise" => Some(Rgba8::from_hex(b"#0ffef9")), - "red pink" => Some(Rgba8::from_hex(b"#fa2a55")), - "red purple" => Some(Rgba8::from_hex(b"#820747")), - "greyish brown" => Some(Rgba8::from_hex(b"#7a6a4f")), - "vermillion" => Some(Rgba8::from_hex(b"#f4320c")), - "russet" => Some(Rgba8::from_hex(b"#a13905")), - "steel grey" => Some(Rgba8::from_hex(b"#6f828a")), - "lighter purple" => Some(Rgba8::from_hex(b"#a55af4")), - "bright violet" => Some(Rgba8::from_hex(b"#ad0afd")), - "prussian blue" => Some(Rgba8::from_hex(b"#004577")), - "slate green" => Some(Rgba8::from_hex(b"#658d6d")), - "dirty pink" => Some(Rgba8::from_hex(b"#ca7b80")), - "dark blue green" => Some(Rgba8::from_hex(b"#005249")), - "pine" => Some(Rgba8::from_hex(b"#2b5d34")), - "yellowy green" => Some(Rgba8::from_hex(b"#bff128")), - "dark gold" => Some(Rgba8::from_hex(b"#b59410")), - "bluish" => Some(Rgba8::from_hex(b"#2976bb")), - "darkish blue" => Some(Rgba8::from_hex(b"#014182")), - "dull red" => Some(Rgba8::from_hex(b"#bb3f3f")), - "pinky red" => Some(Rgba8::from_hex(b"#fc2647")), - "bronze" => Some(Rgba8::from_hex(b"#a87900")), - "pale teal" => Some(Rgba8::from_hex(b"#82cbb2")), - "military green" => Some(Rgba8::from_hex(b"#667c3e")), - "barbie pink" => Some(Rgba8::from_hex(b"#fe46a5")), - "bubblegum pink" => Some(Rgba8::from_hex(b"#fe83cc")), - "pea soup green" => Some(Rgba8::from_hex(b"#94a617")), - "dark mustard" => Some(Rgba8::from_hex(b"#a88905")), - "shit" => Some(Rgba8::from_hex(b"#7f5f00")), - "medium purple" => Some(Rgba8::from_hex(b"#9e43a2")), - "very dark green" => Some(Rgba8::from_hex(b"#062e03")), - "dirt" => Some(Rgba8::from_hex(b"#8a6e45")), - "dusky pink" => Some(Rgba8::from_hex(b"#cc7a8b")), - "red violet" => Some(Rgba8::from_hex(b"#9e0168")), - "lemon yellow" => Some(Rgba8::from_hex(b"#fdff38")), - "pistachio" => Some(Rgba8::from_hex(b"#c0fa8b")), - "dull yellow" => Some(Rgba8::from_hex(b"#eedc5b")), - "dark lime green" => Some(Rgba8::from_hex(b"#7ebd01")), - "denim blue" => Some(Rgba8::from_hex(b"#3b5b92")), - "teal blue" => Some(Rgba8::from_hex(b"#01889f")), - "lightish blue" => Some(Rgba8::from_hex(b"#3d7afd")), - "purpley blue" => Some(Rgba8::from_hex(b"#5f34e7")), - "light indigo" => Some(Rgba8::from_hex(b"#6d5acf")), - "swamp green" => Some(Rgba8::from_hex(b"#748500")), - "brown green" => Some(Rgba8::from_hex(b"#706c11")), - "dark maroon" => Some(Rgba8::from_hex(b"#3c0008")), - "hot purple" => Some(Rgba8::from_hex(b"#cb00f5")), - "dark forest green" => Some(Rgba8::from_hex(b"#002d04")), - "faded blue" => Some(Rgba8::from_hex(b"#658cbb")), - "drab green" => Some(Rgba8::from_hex(b"#749551")), - "light lime green" => Some(Rgba8::from_hex(b"#b9ff66")), - "snot green" => Some(Rgba8::from_hex(b"#9dc100")), - "yellowish" => Some(Rgba8::from_hex(b"#faee66")), - "light blue green" => Some(Rgba8::from_hex(b"#7efbb3")), - "bordeaux" => Some(Rgba8::from_hex(b"#7b002c")), - "light mauve" => Some(Rgba8::from_hex(b"#c292a1")), - "ocean" => Some(Rgba8::from_hex(b"#017b92")), - "marigold" => Some(Rgba8::from_hex(b"#fcc006")), - "muddy green" => Some(Rgba8::from_hex(b"#657432")), - "dull orange" => Some(Rgba8::from_hex(b"#d8863b")), - "steel" => Some(Rgba8::from_hex(b"#738595")), - "electric purple" => Some(Rgba8::from_hex(b"#aa23ff")), - "fluorescent green" => Some(Rgba8::from_hex(b"#08ff08")), - "yellowish brown" => Some(Rgba8::from_hex(b"#9b7a01")), - "blush" => Some(Rgba8::from_hex(b"#f29e8e")), - "soft green" => Some(Rgba8::from_hex(b"#6fc276")), - "bright orange" => Some(Rgba8::from_hex(b"#ff5b00")), - "lemon" => Some(Rgba8::from_hex(b"#fdff52")), - "purple grey" => Some(Rgba8::from_hex(b"#866f85")), - "acid green" => Some(Rgba8::from_hex(b"#8ffe09")), - "pale lavender" => Some(Rgba8::from_hex(b"#eecffe")), - "violet blue" => Some(Rgba8::from_hex(b"#510ac9")), - "light forest green" => Some(Rgba8::from_hex(b"#4f9153")), - "burnt red" => Some(Rgba8::from_hex(b"#9f2305")), - "khaki green" => Some(Rgba8::from_hex(b"#728639")), - "cerise" => Some(Rgba8::from_hex(b"#de0c62")), - "faded purple" => Some(Rgba8::from_hex(b"#916e99")), - "apricot" => Some(Rgba8::from_hex(b"#ffb16d")), - "dark olive green" => Some(Rgba8::from_hex(b"#3c4d03")), - "grey brown" => Some(Rgba8::from_hex(b"#7f7053")), - "green grey" => Some(Rgba8::from_hex(b"#77926f")), - "true blue" => Some(Rgba8::from_hex(b"#010fcc")), - "pale violet" => Some(Rgba8::from_hex(b"#ceaefa")), - "periwinkle blue" => Some(Rgba8::from_hex(b"#8f99fb")), - "light sky blue" => Some(Rgba8::from_hex(b"#c6fcff")), - "blurple" => Some(Rgba8::from_hex(b"#5539cc")), - "green brown" => Some(Rgba8::from_hex(b"#544e03")), - "bluegreen" => Some(Rgba8::from_hex(b"#017a79")), - "bright teal" => Some(Rgba8::from_hex(b"#01f9c6")), - "brownish yellow" => Some(Rgba8::from_hex(b"#c9b003")), - "pea soup" => Some(Rgba8::from_hex(b"#929901")), - "forest" => Some(Rgba8::from_hex(b"#0b5509")), - "barney purple" => Some(Rgba8::from_hex(b"#a00498")), - "ultramarine" => Some(Rgba8::from_hex(b"#2000b1")), - "purplish" => Some(Rgba8::from_hex(b"#94568c")), - "puke yellow" => Some(Rgba8::from_hex(b"#c2be0e")), - "bluish grey" => Some(Rgba8::from_hex(b"#748b97")), - "dark periwinkle" => Some(Rgba8::from_hex(b"#665fd1")), - "dark lilac" => Some(Rgba8::from_hex(b"#9c6da5")), - "reddish" => Some(Rgba8::from_hex(b"#c44240")), - "light maroon" => Some(Rgba8::from_hex(b"#a24857")), - "dusty purple" => Some(Rgba8::from_hex(b"#825f87")), - "terra cotta" => Some(Rgba8::from_hex(b"#c9643b")), - "avocado" => Some(Rgba8::from_hex(b"#90b134")), - "marine blue" => Some(Rgba8::from_hex(b"#01386a")), - "teal green" => Some(Rgba8::from_hex(b"#25a36f")), - "slate grey" => Some(Rgba8::from_hex(b"#59656d")), - "lighter green" => Some(Rgba8::from_hex(b"#75fd63")), - "electric green" => Some(Rgba8::from_hex(b"#21fc0d")), - "dusty blue" => Some(Rgba8::from_hex(b"#5a86ad")), - "golden yellow" => Some(Rgba8::from_hex(b"#fec615")), - "bright yellow" => Some(Rgba8::from_hex(b"#fffd01")), - "light lavender" => Some(Rgba8::from_hex(b"#dfc5fe")), - "umber" => Some(Rgba8::from_hex(b"#b26400")), - "poop" => Some(Rgba8::from_hex(b"#7f5e00")), - "dark peach" => Some(Rgba8::from_hex(b"#de7e5d")), - "jungle green" => Some(Rgba8::from_hex(b"#048243")), - "eggshell" => Some(Rgba8::from_hex(b"#ffffd4")), - "denim" => Some(Rgba8::from_hex(b"#3b638c")), - "yellow brown" => Some(Rgba8::from_hex(b"#b79400")), - "dull purple" => Some(Rgba8::from_hex(b"#84597e")), - "chocolate brown" => Some(Rgba8::from_hex(b"#411900")), - "wine red" => Some(Rgba8::from_hex(b"#7b0323")), - "neon blue" => Some(Rgba8::from_hex(b"#04d9ff")), - "dirty green" => Some(Rgba8::from_hex(b"#667e2c")), - "light tan" => Some(Rgba8::from_hex(b"#fbeeac")), - "ice blue" => Some(Rgba8::from_hex(b"#d7fffe")), - "cadet blue" => Some(Rgba8::from_hex(b"#4e7496")), - "dark mauve" => Some(Rgba8::from_hex(b"#874c62")), - "very light blue" => Some(Rgba8::from_hex(b"#d5ffff")), - "grey purple" => Some(Rgba8::from_hex(b"#826d8c")), - "pastel pink" => Some(Rgba8::from_hex(b"#ffbacd")), - "very light green" => Some(Rgba8::from_hex(b"#d1ffbd")), - "dark sky blue" => Some(Rgba8::from_hex(b"#448ee4")), - "evergreen" => Some(Rgba8::from_hex(b"#05472a")), - "dull pink" => Some(Rgba8::from_hex(b"#d5869d")), - "aubergine" => Some(Rgba8::from_hex(b"#3d0734")), - "mahogany" => Some(Rgba8::from_hex(b"#4a0100")), - "reddish orange" => Some(Rgba8::from_hex(b"#f8481c")), - "deep green" => Some(Rgba8::from_hex(b"#02590f")), - "vomit green" => Some(Rgba8::from_hex(b"#89a203")), - "purple pink" => Some(Rgba8::from_hex(b"#e03fd8")), - "dusty pink" => Some(Rgba8::from_hex(b"#d58a94")), - "faded green" => Some(Rgba8::from_hex(b"#7bb274")), - "camo green" => Some(Rgba8::from_hex(b"#526525")), - "pinky purple" => Some(Rgba8::from_hex(b"#c94cbe")), - "pink purple" => Some(Rgba8::from_hex(b"#db4bda")), - "brownish red" => Some(Rgba8::from_hex(b"#9e3623")), - "dark rose" => Some(Rgba8::from_hex(b"#b5485d")), - "mud" => Some(Rgba8::from_hex(b"#735c12")), - "brownish" => Some(Rgba8::from_hex(b"#9c6d57")), - "emerald green" => Some(Rgba8::from_hex(b"#028f1e")), - "pale brown" => Some(Rgba8::from_hex(b"#b1916e")), - "dull blue" => Some(Rgba8::from_hex(b"#49759c")), - "burnt umber" => Some(Rgba8::from_hex(b"#a0450e")), - "medium green" => Some(Rgba8::from_hex(b"#39ad48")), - "clay" => Some(Rgba8::from_hex(b"#b66a50")), - "light aqua" => Some(Rgba8::from_hex(b"#8cffdb")), - "light olive green" => Some(Rgba8::from_hex(b"#a4be5c")), - "brownish orange" => Some(Rgba8::from_hex(b"#cb7723")), - "dark aqua" => Some(Rgba8::from_hex(b"#05696b")), - "purplish pink" => Some(Rgba8::from_hex(b"#ce5dae")), - "dark salmon" => Some(Rgba8::from_hex(b"#c85a53")), - "greenish grey" => Some(Rgba8::from_hex(b"#96ae8d")), - "jade" => Some(Rgba8::from_hex(b"#1fa774")), - "ugly green" => Some(Rgba8::from_hex(b"#7a9703")), - "dark beige" => Some(Rgba8::from_hex(b"#ac9362")), - "emerald" => Some(Rgba8::from_hex(b"#01a049")), - "pale red" => Some(Rgba8::from_hex(b"#d9544d")), - "light magenta" => Some(Rgba8::from_hex(b"#fa5ff7")), - "sky" => Some(Rgba8::from_hex(b"#82cafc")), - "light cyan" => Some(Rgba8::from_hex(b"#acfffc")), - "yellow orange" => Some(Rgba8::from_hex(b"#fcb001")), - "reddish purple" => Some(Rgba8::from_hex(b"#910951")), - "reddish pink" => Some(Rgba8::from_hex(b"#fe2c54")), - "orchid" => Some(Rgba8::from_hex(b"#c875c4")), - "dirty yellow" => Some(Rgba8::from_hex(b"#cdc50a")), - "orange red" => Some(Rgba8::from_hex(b"#fd411e")), - "deep red" => Some(Rgba8::from_hex(b"#9a0200")), - "orange brown" => Some(Rgba8::from_hex(b"#be6400")), - "cobalt blue" => Some(Rgba8::from_hex(b"#030aa7")), - "neon pink" => Some(Rgba8::from_hex(b"#fe019a")), - "rose pink" => Some(Rgba8::from_hex(b"#f7879a")), - "greyish purple" => Some(Rgba8::from_hex(b"#887191")), - "raspberry" => Some(Rgba8::from_hex(b"#b00149")), - "aqua green" => Some(Rgba8::from_hex(b"#12e193")), - "salmon pink" => Some(Rgba8::from_hex(b"#fe7b7c")), - "tangerine" => Some(Rgba8::from_hex(b"#ff9408")), - "brownish green" => Some(Rgba8::from_hex(b"#6a6e09")), - "red brown" => Some(Rgba8::from_hex(b"#8b2e16")), - "greenish brown" => Some(Rgba8::from_hex(b"#696112")), - "pumpkin" => Some(Rgba8::from_hex(b"#e17701")), - "pine green" => Some(Rgba8::from_hex(b"#0a481e")), - "charcoal" => Some(Rgba8::from_hex(b"#343837")), - "baby pink" => Some(Rgba8::from_hex(b"#ffb7ce")), - "cornflower" => Some(Rgba8::from_hex(b"#6a79f7")), - "blue violet" => Some(Rgba8::from_hex(b"#5d06e9")), - "chocolate" => Some(Rgba8::from_hex(b"#3d1c02")), - "greyish green" => Some(Rgba8::from_hex(b"#82a67d")), - "scarlet" => Some(Rgba8::from_hex(b"#be0119")), - "green yellow" => Some(Rgba8::from_hex(b"#c9ff27")), - "dark olive" => Some(Rgba8::from_hex(b"#373e02")), - "sienna" => Some(Rgba8::from_hex(b"#a9561e")), - "pastel purple" => Some(Rgba8::from_hex(b"#caa0ff")), - "terracotta" => Some(Rgba8::from_hex(b"#ca6641")), - "aqua blue" => Some(Rgba8::from_hex(b"#02d8e9")), - "sage green" => Some(Rgba8::from_hex(b"#88b378")), - "blood red" => Some(Rgba8::from_hex(b"#980002")), - "deep pink" => Some(Rgba8::from_hex(b"#cb0162")), - "grass" => Some(Rgba8::from_hex(b"#5cac2d")), - "moss" => Some(Rgba8::from_hex(b"#769958")), - "pastel blue" => Some(Rgba8::from_hex(b"#a2bffe")), - "bluish green" => Some(Rgba8::from_hex(b"#10a674")), - "green blue" => Some(Rgba8::from_hex(b"#06b48b")), - "dark tan" => Some(Rgba8::from_hex(b"#af884a")), - "greenish blue" => Some(Rgba8::from_hex(b"#0b8b87")), - "pale orange" => Some(Rgba8::from_hex(b"#ffa756")), - "vomit" => Some(Rgba8::from_hex(b"#a2a415")), - "forrest green" => Some(Rgba8::from_hex(b"#154406")), - "dark lavender" => Some(Rgba8::from_hex(b"#856798")), - "dark violet" => Some(Rgba8::from_hex(b"#34013f")), - "purple blue" => Some(Rgba8::from_hex(b"#632de9")), - "dark cyan" => Some(Rgba8::from_hex(b"#0a888a")), - "olive drab" => Some(Rgba8::from_hex(b"#6f7632")), - "pinkish" => Some(Rgba8::from_hex(b"#d46a7e")), - "cobalt" => Some(Rgba8::from_hex(b"#1e488f")), - "neon purple" => Some(Rgba8::from_hex(b"#bc13fe")), - "light turquoise" => Some(Rgba8::from_hex(b"#7ef4cc")), - "apple green" => Some(Rgba8::from_hex(b"#76cd26")), - "dull green" => Some(Rgba8::from_hex(b"#74a662")), - "wine" => Some(Rgba8::from_hex(b"#80013f")), - "powder blue" => Some(Rgba8::from_hex(b"#b1d1fc")), - "off white" => Some(Rgba8::from_hex(b"#ffffe4")), - "electric blue" => Some(Rgba8::from_hex(b"#0652ff")), - "dark turquoise" => Some(Rgba8::from_hex(b"#045c5a")), - "blue purple" => Some(Rgba8::from_hex(b"#5729ce")), - "azure" => Some(Rgba8::from_hex(b"#069af3")), - "bright red" => Some(Rgba8::from_hex(b"#ff000d")), - "pinkish red" => Some(Rgba8::from_hex(b"#f10c45")), - "cornflower blue" => Some(Rgba8::from_hex(b"#5170d7")), - "light olive" => Some(Rgba8::from_hex(b"#acbf69")), - "grape" => Some(Rgba8::from_hex(b"#6c3461")), - "greyish blue" => Some(Rgba8::from_hex(b"#5e819d")), - "purplish blue" => Some(Rgba8::from_hex(b"#601ef9")), - "yellowish green" => Some(Rgba8::from_hex(b"#b0dd16")), - "greenish yellow" => Some(Rgba8::from_hex(b"#cdfd02")), - "medium blue" => Some(Rgba8::from_hex(b"#2c6fbb")), - "dusty rose" => Some(Rgba8::from_hex(b"#c0737a")), - "light violet" => Some(Rgba8::from_hex(b"#d6b4fc")), - "midnight blue" => Some(Rgba8::from_hex(b"#020035")), - "bluish purple" => Some(Rgba8::from_hex(b"#703be7")), - "red orange" => Some(Rgba8::from_hex(b"#fd3c06")), - "dark magenta" => Some(Rgba8::from_hex(b"#960056")), - "greenish" => Some(Rgba8::from_hex(b"#40a368")), - "ocean blue" => Some(Rgba8::from_hex(b"#03719c")), - "coral" => Some(Rgba8::from_hex(b"#fc5a50")), - "cream" => Some(Rgba8::from_hex(b"#ffffc2")), - "reddish brown" => Some(Rgba8::from_hex(b"#7f2b0a")), - "burnt sienna" => Some(Rgba8::from_hex(b"#b04e0f")), - "brick" => Some(Rgba8::from_hex(b"#a03623")), - "sage" => Some(Rgba8::from_hex(b"#87ae73")), - "grey green" => Some(Rgba8::from_hex(b"#789b73")), - "white" => Some(Rgba8::from_hex(b"#ffffff")), - "robin's egg blue" => Some(Rgba8::from_hex(b"#98eff9")), - "moss green" => Some(Rgba8::from_hex(b"#658b38")), - "steel blue" => Some(Rgba8::from_hex(b"#5a7d9a")), - "eggplant" => Some(Rgba8::from_hex(b"#380835")), - "light yellow" => Some(Rgba8::from_hex(b"#fffe7a")), - "leaf green" => Some(Rgba8::from_hex(b"#5ca904")), - "light grey" => Some(Rgba8::from_hex(b"#d8dcd6")), - "puke" => Some(Rgba8::from_hex(b"#a5a502")), - "pinkish purple" => Some(Rgba8::from_hex(b"#d648d7")), - "sea blue" => Some(Rgba8::from_hex(b"#047495")), - "pale purple" => Some(Rgba8::from_hex(b"#b790d4")), - "slate blue" => Some(Rgba8::from_hex(b"#5b7c99")), - "blue grey" => Some(Rgba8::from_hex(b"#607c8e")), - "hunter green" => Some(Rgba8::from_hex(b"#0b4008")), - "fuchsia" => Some(Rgba8::from_hex(b"#ed0dd9")), - "crimson" => Some(Rgba8::from_hex(b"#8c000f")), - "pale yellow" => Some(Rgba8::from_hex(b"#ffff84")), - "ochre" => Some(Rgba8::from_hex(b"#bf9005")), - "mustard yellow" => Some(Rgba8::from_hex(b"#d2bd0a")), - "light red" => Some(Rgba8::from_hex(b"#ff474c")), - "cerulean" => Some(Rgba8::from_hex(b"#0485d1")), - "pale pink" => Some(Rgba8::from_hex(b"#ffcfdc")), - "deep blue" => Some(Rgba8::from_hex(b"#040273")), - "rust" => Some(Rgba8::from_hex(b"#a83c09")), - "light teal" => Some(Rgba8::from_hex(b"#90e4c1")), - "slate" => Some(Rgba8::from_hex(b"#516572")), - "goldenrod" => Some(Rgba8::from_hex(b"#fac205")), - "dark yellow" => Some(Rgba8::from_hex(b"#d5b60a")), - "dark grey" => Some(Rgba8::from_hex(b"#363737")), - "army green" => Some(Rgba8::from_hex(b"#4b5d16")), - "grey blue" => Some(Rgba8::from_hex(b"#6b8ba4")), - "seafoam" => Some(Rgba8::from_hex(b"#80f9ad")), - "puce" => Some(Rgba8::from_hex(b"#a57e52")), - "spring green" => Some(Rgba8::from_hex(b"#a9f971")), - "dark orange" => Some(Rgba8::from_hex(b"#c65102")), - "sand" => Some(Rgba8::from_hex(b"#e2ca76")), - "pastel green" => Some(Rgba8::from_hex(b"#b0ff9d")), - "mint" => Some(Rgba8::from_hex(b"#9ffeb0")), - "light orange" => Some(Rgba8::from_hex(b"#fdaa48")), - "bright pink" => Some(Rgba8::from_hex(b"#fe01b1")), - "chartreuse" => Some(Rgba8::from_hex(b"#c1f80a")), - "deep purple" => Some(Rgba8::from_hex(b"#36013f")), - "dark brown" => Some(Rgba8::from_hex(b"#341c02")), - "taupe" => Some(Rgba8::from_hex(b"#b9a281")), - "pea green" => Some(Rgba8::from_hex(b"#8eab12")), - "puke green" => Some(Rgba8::from_hex(b"#9aae07")), - "kelly green" => Some(Rgba8::from_hex(b"#02ab2e")), - "seafoam green" => Some(Rgba8::from_hex(b"#7af9ab")), - "blue green" => Some(Rgba8::from_hex(b"#137e6d")), - "khaki" => Some(Rgba8::from_hex(b"#aaa662")), - "burgundy" => Some(Rgba8::from_hex(b"#610023")), - "dark teal" => Some(Rgba8::from_hex(b"#014d4e")), - "brick red" => Some(Rgba8::from_hex(b"#8f1402")), - "royal purple" => Some(Rgba8::from_hex(b"#4b006e")), - "plum" => Some(Rgba8::from_hex(b"#580f41")), - "mint green" => Some(Rgba8::from_hex(b"#8fff9f")), - "gold" => Some(Rgba8::from_hex(b"#dbb40c")), - "baby blue" => Some(Rgba8::from_hex(b"#a2cffe")), - "yellow green" => Some(Rgba8::from_hex(b"#c0fb2d")), - "bright purple" => Some(Rgba8::from_hex(b"#be03fd")), - "dark red" => Some(Rgba8::from_hex(b"#840000")), - "pale blue" => Some(Rgba8::from_hex(b"#d0fefe")), - "grass green" => Some(Rgba8::from_hex(b"#3f9b0b")), - "navy" => Some(Rgba8::from_hex(b"#01153e")), - "aquamarine" => Some(Rgba8::from_hex(b"#04d8b2")), - "burnt orange" => Some(Rgba8::from_hex(b"#c04e01")), - "neon green" => Some(Rgba8::from_hex(b"#0cff0c")), - "bright blue" => Some(Rgba8::from_hex(b"#0165fc")), - "rose" => Some(Rgba8::from_hex(b"#cf6275")), - "light pink" => Some(Rgba8::from_hex(b"#ffd1df")), - "mustard" => Some(Rgba8::from_hex(b"#ceb301")), - "indigo" => Some(Rgba8::from_hex(b"#380282")), - "lime" => Some(Rgba8::from_hex(b"#aaff32")), - "sea green" => Some(Rgba8::from_hex(b"#53fca1")), - "periwinkle" => Some(Rgba8::from_hex(b"#8e82fe")), - "dark pink" => Some(Rgba8::from_hex(b"#cb416b")), - "olive green" => Some(Rgba8::from_hex(b"#677a04")), - "peach" => Some(Rgba8::from_hex(b"#ffb07c")), - "pale green" => Some(Rgba8::from_hex(b"#c7fdb5")), - "light brown" => Some(Rgba8::from_hex(b"#ad8150")), - "hot pink" => Some(Rgba8::from_hex(b"#ff028d")), - "black" => Some(Rgba8::from_hex(b"#000000")), - "lilac" => Some(Rgba8::from_hex(b"#cea2fd")), - "navy blue" => Some(Rgba8::from_hex(b"#001146")), - "royal blue" => Some(Rgba8::from_hex(b"#0504aa")), - "beige" => Some(Rgba8::from_hex(b"#e6daa6")), - "salmon" => Some(Rgba8::from_hex(b"#ff796c")), - "olive" => Some(Rgba8::from_hex(b"#6e750e")), - "maroon" => Some(Rgba8::from_hex(b"#650021")), - "bright green" => Some(Rgba8::from_hex(b"#01ff07")), - "dark purple" => Some(Rgba8::from_hex(b"#35063e")), - "mauve" => Some(Rgba8::from_hex(b"#ae7181")), - "forest green" => Some(Rgba8::from_hex(b"#06470c")), - "aqua" => Some(Rgba8::from_hex(b"#13eac9")), - "cyan" => Some(Rgba8::from_hex(b"#00ffff")), - "tan" => Some(Rgba8::from_hex(b"#d1b26f")), - "dark blue" => Some(Rgba8::from_hex(b"#00035b")), - "lavender" => Some(Rgba8::from_hex(b"#c79fef")), - "turquoise" => Some(Rgba8::from_hex(b"#06c2ac")), - "dark green" => Some(Rgba8::from_hex(b"#033500")), - "violet" => Some(Rgba8::from_hex(b"#9a0eea")), - "light purple" => Some(Rgba8::from_hex(b"#bf77f6")), - "lime green" => Some(Rgba8::from_hex(b"#89fe05")), - "grey" => Some(Rgba8::from_hex(b"#929591")), - "sky blue" => Some(Rgba8::from_hex(b"#75bbfd")), - "yellow" => Some(Rgba8::from_hex(b"#ffff14")), - "magenta" => Some(Rgba8::from_hex(b"#c20078")), - "light green" => Some(Rgba8::from_hex(b"#96f97b")), - "orange" => Some(Rgba8::from_hex(b"#f97306")), - "teal" => Some(Rgba8::from_hex(b"#029386")), - "light blue" => Some(Rgba8::from_hex(b"#95d0fc")), - "red" => Some(Rgba8::from_hex(b"#e50000")), - "brown" => Some(Rgba8::from_hex(b"#653700")), - "pink" => Some(Rgba8::from_hex(b"#ff81c0")), - "blue" => Some(Rgba8::from_hex(b"#0343df")), - "green" => Some(Rgba8::from_hex(b"#15b01a")), - "purple" => Some(Rgba8::from_hex(b"#7e1e9c")), - _ => None, - } -} +pub const COLORS: &[(&str, Rgba8)] = &[ + ("cloudy blue", Rgba8::from_hex(b"#acc2d9")), + ("dark pastel green", Rgba8::from_hex(b"#56ae57")), + ("dust", Rgba8::from_hex(b"#b2996e")), + ("electric lime", Rgba8::from_hex(b"#a8ff04")), + ("fresh green", Rgba8::from_hex(b"#69d84f")), + ("light eggplant", Rgba8::from_hex(b"#894585")), + ("nasty green", Rgba8::from_hex(b"#70b23f")), + ("really light blue", Rgba8::from_hex(b"#d4ffff")), + ("tea", Rgba8::from_hex(b"#65ab7c")), + ("warm purple", Rgba8::from_hex(b"#952e8f")), + ("yellowish tan", Rgba8::from_hex(b"#fcfc81")), + ("cement", Rgba8::from_hex(b"#a5a391")), + ("dark grass green", Rgba8::from_hex(b"#388004")), + ("dusty teal", Rgba8::from_hex(b"#4c9085")), + ("grey teal", Rgba8::from_hex(b"#5e9b8a")), + ("macaroni and cheese", Rgba8::from_hex(b"#efb435")), + ("pinkish tan", Rgba8::from_hex(b"#d99b82")), + ("spruce", Rgba8::from_hex(b"#0a5f38")), + ("strong blue", Rgba8::from_hex(b"#0c06f7")), + ("toxic green", Rgba8::from_hex(b"#61de2a")), + ("windows blue", Rgba8::from_hex(b"#3778bf")), + ("blue blue", Rgba8::from_hex(b"#2242c7")), + ("blue with a hint of purple", Rgba8::from_hex(b"#533cc6")), + ("booger", Rgba8::from_hex(b"#9bb53c")), + ("bright sea green", Rgba8::from_hex(b"#05ffa6")), + ("dark green blue", Rgba8::from_hex(b"#1f6357")), + ("deep turquoise", Rgba8::from_hex(b"#017374")), + ("green teal", Rgba8::from_hex(b"#0cb577")), + ("strong pink", Rgba8::from_hex(b"#ff0789")), + ("bland", Rgba8::from_hex(b"#afa88b")), + ("deep aqua", Rgba8::from_hex(b"#08787f")), + ("lavender pink", Rgba8::from_hex(b"#dd85d7")), + ("light moss green", Rgba8::from_hex(b"#a6c875")), + ("light seafoam green", Rgba8::from_hex(b"#a7ffb5")), + ("olive yellow", Rgba8::from_hex(b"#c2b709")), + ("pig pink", Rgba8::from_hex(b"#e78ea5")), + ("deep lilac", Rgba8::from_hex(b"#966ebd")), + ("desert", Rgba8::from_hex(b"#ccad60")), + ("dusty lavender", Rgba8::from_hex(b"#ac86a8")), + ("purpley grey", Rgba8::from_hex(b"#947e94")), + ("purply", Rgba8::from_hex(b"#983fb2")), + ("candy pink", Rgba8::from_hex(b"#ff63e9")), + ("light pastel green", Rgba8::from_hex(b"#b2fba5")), + ("boring green", Rgba8::from_hex(b"#63b365")), + ("kiwi green", Rgba8::from_hex(b"#8ee53f")), + ("light grey green", Rgba8::from_hex(b"#b7e1a1")), + ("orange pink", Rgba8::from_hex(b"#ff6f52")), + ("tea green", Rgba8::from_hex(b"#bdf8a3")), + ("very light brown", Rgba8::from_hex(b"#d3b683")), + ("egg shell", Rgba8::from_hex(b"#fffcc4")), + ("eggplant purple", Rgba8::from_hex(b"#430541")), + ("powder pink", Rgba8::from_hex(b"#ffb2d0")), + ("reddish grey", Rgba8::from_hex(b"#997570")), + ("baby shit brown", Rgba8::from_hex(b"#ad900d")), + ("liliac", Rgba8::from_hex(b"#c48efd")), + ("stormy blue", Rgba8::from_hex(b"#507b9c")), + ("ugly brown", Rgba8::from_hex(b"#7d7103")), + ("custard", Rgba8::from_hex(b"#fffd78")), + ("darkish pink", Rgba8::from_hex(b"#da467d")), + ("deep brown", Rgba8::from_hex(b"#410200")), + ("greenish beige", Rgba8::from_hex(b"#c9d179")), + ("manilla", Rgba8::from_hex(b"#fffa86")), + ("off blue", Rgba8::from_hex(b"#5684ae")), + ("battleship grey", Rgba8::from_hex(b"#6b7c85")), + ("browny green", Rgba8::from_hex(b"#6f6c0a")), + ("bruise", Rgba8::from_hex(b"#7e4071")), + ("kelley green", Rgba8::from_hex(b"#009337")), + ("sickly yellow", Rgba8::from_hex(b"#d0e429")), + ("sunny yellow", Rgba8::from_hex(b"#fff917")), + ("azul", Rgba8::from_hex(b"#1d5dec")), + ("green/yellow", Rgba8::from_hex(b"#b5ce08")), + ("lichen", Rgba8::from_hex(b"#8fb67b")), + ("light light green", Rgba8::from_hex(b"#c8ffb0")), + ("pale gold", Rgba8::from_hex(b"#fdde6c")), + ("sun yellow", Rgba8::from_hex(b"#ffdf22")), + ("tan green", Rgba8::from_hex(b"#a9be70")), + ("burple", Rgba8::from_hex(b"#6832e3")), + ("butterscotch", Rgba8::from_hex(b"#fdb147")), + ("toupe", Rgba8::from_hex(b"#c7ac7d")), + ("dark cream", Rgba8::from_hex(b"#fff39a")), + ("indian red", Rgba8::from_hex(b"#850e04")), + ("light lavendar", Rgba8::from_hex(b"#efc0fe")), + ("poison green", Rgba8::from_hex(b"#40fd14")), + ("baby puke green", Rgba8::from_hex(b"#b6c406")), + ("bright yellow green", Rgba8::from_hex(b"#9dff00")), + ("charcoal grey", Rgba8::from_hex(b"#3c4142")), + ("squash", Rgba8::from_hex(b"#f2ab15")), + ("cinnamon", Rgba8::from_hex(b"#ac4f06")), + ("light pea green", Rgba8::from_hex(b"#c4fe82")), + ("radioactive green", Rgba8::from_hex(b"#2cfa1f")), + ("raw sienna", Rgba8::from_hex(b"#9a6200")), + ("baby purple", Rgba8::from_hex(b"#ca9bf7")), + ("cocoa", Rgba8::from_hex(b"#875f42")), + ("light royal blue", Rgba8::from_hex(b"#3a2efe")), + ("orangeish", Rgba8::from_hex(b"#fd8d49")), + ("rust brown", Rgba8::from_hex(b"#8b3103")), + ("sand brown", Rgba8::from_hex(b"#cba560")), + ("swamp", Rgba8::from_hex(b"#698339")), + ("tealish green", Rgba8::from_hex(b"#0cdc73")), + ("burnt siena", Rgba8::from_hex(b"#b75203")), + ("camo", Rgba8::from_hex(b"#7f8f4e")), + ("dusk blue", Rgba8::from_hex(b"#26538d")), + ("fern", Rgba8::from_hex(b"#63a950")), + ("old rose", Rgba8::from_hex(b"#c87f89")), + ("pale light green", Rgba8::from_hex(b"#b1fc99")), + ("peachy pink", Rgba8::from_hex(b"#ff9a8a")), + ("rosy pink", Rgba8::from_hex(b"#f6688e")), + ("light bluish green", Rgba8::from_hex(b"#76fda8")), + ("light bright green", Rgba8::from_hex(b"#53fe5c")), + ("light neon green", Rgba8::from_hex(b"#4efd54")), + ("light seafoam", Rgba8::from_hex(b"#a0febf")), + ("tiffany blue", Rgba8::from_hex(b"#7bf2da")), + ("washed out green", Rgba8::from_hex(b"#bcf5a6")), + ("browny orange", Rgba8::from_hex(b"#ca6b02")), + ("nice blue", Rgba8::from_hex(b"#107ab0")), + ("sapphire", Rgba8::from_hex(b"#2138ab")), + ("greyish teal", Rgba8::from_hex(b"#719f91")), + ("orangey yellow", Rgba8::from_hex(b"#fdb915")), + ("parchment", Rgba8::from_hex(b"#fefcaf")), + ("straw", Rgba8::from_hex(b"#fcf679")), + ("very dark brown", Rgba8::from_hex(b"#1d0200")), + ("terracota", Rgba8::from_hex(b"#cb6843")), + ("ugly blue", Rgba8::from_hex(b"#31668a")), + ("clear blue", Rgba8::from_hex(b"#247afd")), + ("creme", Rgba8::from_hex(b"#ffffb6")), + ("foam green", Rgba8::from_hex(b"#90fda9")), + ("grey/green", Rgba8::from_hex(b"#86a17d")), + ("light gold", Rgba8::from_hex(b"#fddc5c")), + ("seafoam blue", Rgba8::from_hex(b"#78d1b6")), + ("topaz", Rgba8::from_hex(b"#13bbaf")), + ("violet pink", Rgba8::from_hex(b"#fb5ffc")), + ("wintergreen", Rgba8::from_hex(b"#20f986")), + ("yellow tan", Rgba8::from_hex(b"#ffe36e")), + ("dark fuchsia", Rgba8::from_hex(b"#9d0759")), + ("indigo blue", Rgba8::from_hex(b"#3a18b1")), + ("light yellowish green", Rgba8::from_hex(b"#c2ff89")), + ("pale magenta", Rgba8::from_hex(b"#d767ad")), + ("rich purple", Rgba8::from_hex(b"#720058")), + ("sunflower yellow", Rgba8::from_hex(b"#ffda03")), + ("green/blue", Rgba8::from_hex(b"#01c08d")), + ("leather", Rgba8::from_hex(b"#ac7434")), + ("racing green", Rgba8::from_hex(b"#014600")), + ("vivid purple", Rgba8::from_hex(b"#9900fa")), + ("dark royal blue", Rgba8::from_hex(b"#02066f")), + ("hazel", Rgba8::from_hex(b"#8e7618")), + ("muted pink", Rgba8::from_hex(b"#d1768f")), + ("booger green", Rgba8::from_hex(b"#96b403")), + ("canary", Rgba8::from_hex(b"#fdff63")), + ("cool grey", Rgba8::from_hex(b"#95a3a6")), + ("dark taupe", Rgba8::from_hex(b"#7f684e")), + ("darkish purple", Rgba8::from_hex(b"#751973")), + ("true green", Rgba8::from_hex(b"#089404")), + ("coral pink", Rgba8::from_hex(b"#ff6163")), + ("dark sage", Rgba8::from_hex(b"#598556")), + ("dark slate blue", Rgba8::from_hex(b"#214761")), + ("flat blue", Rgba8::from_hex(b"#3c73a8")), + ("mushroom", Rgba8::from_hex(b"#ba9e88")), + ("rich blue", Rgba8::from_hex(b"#021bf9")), + ("dirty purple", Rgba8::from_hex(b"#734a65")), + ("greenblue", Rgba8::from_hex(b"#23c48b")), + ("icky green", Rgba8::from_hex(b"#8fae22")), + ("light khaki", Rgba8::from_hex(b"#e6f2a2")), + ("warm blue", Rgba8::from_hex(b"#4b57db")), + ("dark hot pink", Rgba8::from_hex(b"#d90166")), + ("deep sea blue", Rgba8::from_hex(b"#015482")), + ("carmine", Rgba8::from_hex(b"#9d0216")), + ("dark yellow green", Rgba8::from_hex(b"#728f02")), + ("pale peach", Rgba8::from_hex(b"#ffe5ad")), + ("plum purple", Rgba8::from_hex(b"#4e0550")), + ("golden rod", Rgba8::from_hex(b"#f9bc08")), + ("neon red", Rgba8::from_hex(b"#ff073a")), + ("old pink", Rgba8::from_hex(b"#c77986")), + ("very pale blue", Rgba8::from_hex(b"#d6fffe")), + ("blood orange", Rgba8::from_hex(b"#fe4b03")), + ("grapefruit", Rgba8::from_hex(b"#fd5956")), + ("sand yellow", Rgba8::from_hex(b"#fce166")), + ("clay brown", Rgba8::from_hex(b"#b2713d")), + ("dark blue grey", Rgba8::from_hex(b"#1f3b4d")), + ("flat green", Rgba8::from_hex(b"#699d4c")), + ("light green blue", Rgba8::from_hex(b"#56fca2")), + ("warm pink", Rgba8::from_hex(b"#fb5581")), + ("dodger blue", Rgba8::from_hex(b"#3e82fc")), + ("gross green", Rgba8::from_hex(b"#a0bf16")), + ("ice", Rgba8::from_hex(b"#d6fffa")), + ("metallic blue", Rgba8::from_hex(b"#4f738e")), + ("pale salmon", Rgba8::from_hex(b"#ffb19a")), + ("sap green", Rgba8::from_hex(b"#5c8b15")), + ("algae", Rgba8::from_hex(b"#54ac68")), + ("bluey grey", Rgba8::from_hex(b"#89a0b0")), + ("greeny grey", Rgba8::from_hex(b"#7ea07a")), + ("highlighter green", Rgba8::from_hex(b"#1bfc06")), + ("light light blue", Rgba8::from_hex(b"#cafffb")), + ("light mint", Rgba8::from_hex(b"#b6ffbb")), + ("raw umber", Rgba8::from_hex(b"#a75e09")), + ("vivid blue", Rgba8::from_hex(b"#152eff")), + ("deep lavender", Rgba8::from_hex(b"#8d5eb7")), + ("dull teal", Rgba8::from_hex(b"#5f9e8f")), + ("light greenish blue", Rgba8::from_hex(b"#63f7b4")), + ("mud green", Rgba8::from_hex(b"#606602")), + ("pinky", Rgba8::from_hex(b"#fc86aa")), + ("red wine", Rgba8::from_hex(b"#8c0034")), + ("shit green", Rgba8::from_hex(b"#758000")), + ("tan brown", Rgba8::from_hex(b"#ab7e4c")), + ("rosa", Rgba8::from_hex(b"#fe86a4")), + ("lipstick", Rgba8::from_hex(b"#d5174e")), + ("pale mauve", Rgba8::from_hex(b"#fed0fc")), + ("claret", Rgba8::from_hex(b"#680018")), + ("dandelion", Rgba8::from_hex(b"#fedf08")), + ("poop green", Rgba8::from_hex(b"#6f7c00")), + ("ruby", Rgba8::from_hex(b"#ca0147")), + ("dark", Rgba8::from_hex(b"#1b2431")), + ("greenish turquoise", Rgba8::from_hex(b"#00fbb0")), + ("pastel red", Rgba8::from_hex(b"#db5856")), + ("piss yellow", Rgba8::from_hex(b"#ddd618")), + ("bright cyan", Rgba8::from_hex(b"#41fdfe")), + ("dark coral", Rgba8::from_hex(b"#cf524e")), + ("algae green", Rgba8::from_hex(b"#21c36f")), + ("darkish red", Rgba8::from_hex(b"#a90308")), + ("reddy brown", Rgba8::from_hex(b"#6e1005")), + ("blush pink", Rgba8::from_hex(b"#fe828c")), + ("camouflage green", Rgba8::from_hex(b"#4b6113")), + ("lawn green", Rgba8::from_hex(b"#4da409")), + ("putty", Rgba8::from_hex(b"#beae8a")), + ("vibrant blue", Rgba8::from_hex(b"#0339f8")), + ("dark sand", Rgba8::from_hex(b"#a88f59")), + ("purple/blue", Rgba8::from_hex(b"#5d21d0")), + ("saffron", Rgba8::from_hex(b"#feb209")), + ("twilight", Rgba8::from_hex(b"#4e518b")), + ("warm brown", Rgba8::from_hex(b"#964e02")), + ("bluegrey", Rgba8::from_hex(b"#85a3b2")), + ("bubble gum pink", Rgba8::from_hex(b"#ff69af")), + ("duck egg blue", Rgba8::from_hex(b"#c3fbf4")), + ("greenish cyan", Rgba8::from_hex(b"#2afeb7")), + ("petrol", Rgba8::from_hex(b"#005f6a")), + ("royal", Rgba8::from_hex(b"#0c1793")), + ("butter", Rgba8::from_hex(b"#ffff81")), + ("dusty orange", Rgba8::from_hex(b"#f0833a")), + ("off yellow", Rgba8::from_hex(b"#f1f33f")), + ("pale olive green", Rgba8::from_hex(b"#b1d27b")), + ("orangish", Rgba8::from_hex(b"#fc824a")), + ("leaf", Rgba8::from_hex(b"#71aa34")), + ("light blue grey", Rgba8::from_hex(b"#b7c9e2")), + ("dried blood", Rgba8::from_hex(b"#4b0101")), + ("lightish purple", Rgba8::from_hex(b"#a552e6")), + ("rusty red", Rgba8::from_hex(b"#af2f0d")), + ("lavender blue", Rgba8::from_hex(b"#8b88f8")), + ("light grass green", Rgba8::from_hex(b"#9af764")), + ("light mint green", Rgba8::from_hex(b"#a6fbb2")), + ("sunflower", Rgba8::from_hex(b"#ffc512")), + ("velvet", Rgba8::from_hex(b"#750851")), + ("brick orange", Rgba8::from_hex(b"#c14a09")), + ("lightish red", Rgba8::from_hex(b"#fe2f4a")), + ("pure blue", Rgba8::from_hex(b"#0203e2")), + ("twilight blue", Rgba8::from_hex(b"#0a437a")), + ("violet red", Rgba8::from_hex(b"#a50055")), + ("yellowy brown", Rgba8::from_hex(b"#ae8b0c")), + ("carnation", Rgba8::from_hex(b"#fd798f")), + ("muddy yellow", Rgba8::from_hex(b"#bfac05")), + ("dark seafoam green", Rgba8::from_hex(b"#3eaf76")), + ("deep rose", Rgba8::from_hex(b"#c74767")), + ("dusty red", Rgba8::from_hex(b"#b9484e")), + ("grey/blue", Rgba8::from_hex(b"#647d8e")), + ("lemon lime", Rgba8::from_hex(b"#bffe28")), + ("purple/pink", Rgba8::from_hex(b"#d725de")), + ("brown yellow", Rgba8::from_hex(b"#b29705")), + ("purple brown", Rgba8::from_hex(b"#673a3f")), + ("wisteria", Rgba8::from_hex(b"#a87dc2")), + ("banana yellow", Rgba8::from_hex(b"#fafe4b")), + ("lipstick red", Rgba8::from_hex(b"#c0022f")), + ("water blue", Rgba8::from_hex(b"#0e87cc")), + ("brown grey", Rgba8::from_hex(b"#8d8468")), + ("vibrant purple", Rgba8::from_hex(b"#ad03de")), + ("baby green", Rgba8::from_hex(b"#8cff9e")), + ("barf green", Rgba8::from_hex(b"#94ac02")), + ("eggshell blue", Rgba8::from_hex(b"#c4fff7")), + ("sandy yellow", Rgba8::from_hex(b"#fdee73")), + ("cool green", Rgba8::from_hex(b"#33b864")), + ("pale", Rgba8::from_hex(b"#fff9d0")), + ("blue/grey", Rgba8::from_hex(b"#758da3")), + ("hot magenta", Rgba8::from_hex(b"#f504c9")), + ("greyblue", Rgba8::from_hex(b"#77a1b5")), + ("purpley", Rgba8::from_hex(b"#8756e4")), + ("baby shit green", Rgba8::from_hex(b"#889717")), + ("brownish pink", Rgba8::from_hex(b"#c27e79")), + ("dark aquamarine", Rgba8::from_hex(b"#017371")), + ("diarrhea", Rgba8::from_hex(b"#9f8303")), + ("light mustard", Rgba8::from_hex(b"#f7d560")), + ("pale sky blue", Rgba8::from_hex(b"#bdf6fe")), + ("turtle green", Rgba8::from_hex(b"#75b84f")), + ("bright olive", Rgba8::from_hex(b"#9cbb04")), + ("dark grey blue", Rgba8::from_hex(b"#29465b")), + ("greeny brown", Rgba8::from_hex(b"#696006")), + ("lemon green", Rgba8::from_hex(b"#adf802")), + ("light periwinkle", Rgba8::from_hex(b"#c1c6fc")), + ("seaweed green", Rgba8::from_hex(b"#35ad6b")), + ("sunshine yellow", Rgba8::from_hex(b"#fffd37")), + ("ugly purple", Rgba8::from_hex(b"#a442a0")), + ("medium pink", Rgba8::from_hex(b"#f36196")), + ("puke brown", Rgba8::from_hex(b"#947706")), + ("very light pink", Rgba8::from_hex(b"#fff4f2")), + ("viridian", Rgba8::from_hex(b"#1e9167")), + ("bile", Rgba8::from_hex(b"#b5c306")), + ("faded yellow", Rgba8::from_hex(b"#feff7f")), + ("very pale green", Rgba8::from_hex(b"#cffdbc")), + ("vibrant green", Rgba8::from_hex(b"#0add08")), + ("bright lime", Rgba8::from_hex(b"#87fd05")), + ("spearmint", Rgba8::from_hex(b"#1ef876")), + ("light aquamarine", Rgba8::from_hex(b"#7bfdc7")), + ("light sage", Rgba8::from_hex(b"#bcecac")), + ("baby poo", Rgba8::from_hex(b"#ab9004")), + ("dark seafoam", Rgba8::from_hex(b"#1fb57a")), + ("deep teal", Rgba8::from_hex(b"#00555a")), + ("heather", Rgba8::from_hex(b"#a484ac")), + ("rust orange", Rgba8::from_hex(b"#c45508")), + ("dirty blue", Rgba8::from_hex(b"#3f829d")), + ("fern green", Rgba8::from_hex(b"#548d44")), + ("bright lilac", Rgba8::from_hex(b"#c95efb")), + ("weird green", Rgba8::from_hex(b"#3ae57f")), + ("peacock blue", Rgba8::from_hex(b"#016795")), + ("avocado green", Rgba8::from_hex(b"#87a922")), + ("faded orange", Rgba8::from_hex(b"#f0944d")), + ("grape purple", Rgba8::from_hex(b"#5d1451")), + ("hot green", Rgba8::from_hex(b"#25ff29")), + ("lime yellow", Rgba8::from_hex(b"#d0fe1d")), + ("mango", Rgba8::from_hex(b"#ffa62b")), + ("shamrock", Rgba8::from_hex(b"#01b44c")), + ("bubblegum", Rgba8::from_hex(b"#ff6cb5")), + ("purplish brown", Rgba8::from_hex(b"#6b4247")), + ("vomit yellow", Rgba8::from_hex(b"#c7c10c")), + ("pale cyan", Rgba8::from_hex(b"#b7fffa")), + ("key lime", Rgba8::from_hex(b"#aeff6e")), + ("tomato red", Rgba8::from_hex(b"#ec2d01")), + ("merlot", Rgba8::from_hex(b"#730039")), + ("night blue", Rgba8::from_hex(b"#040348")), + ("purpleish pink", Rgba8::from_hex(b"#df4ec8")), + ("apple", Rgba8::from_hex(b"#6ecb3c")), + ("baby poop green", Rgba8::from_hex(b"#8f9805")), + ("green apple", Rgba8::from_hex(b"#5edc1f")), + ("heliotrope", Rgba8::from_hex(b"#d94ff5")), + ("yellow/green", Rgba8::from_hex(b"#c8fd3d")), + ("almost black", Rgba8::from_hex(b"#070d0d")), + ("cool blue", Rgba8::from_hex(b"#4984b8")), + ("leafy green", Rgba8::from_hex(b"#51b73b")), + ("mustard brown", Rgba8::from_hex(b"#ac7e04")), + ("dusk", Rgba8::from_hex(b"#4e5481")), + ("dull brown", Rgba8::from_hex(b"#876e4b")), + ("frog green", Rgba8::from_hex(b"#58bc08")), + ("vivid green", Rgba8::from_hex(b"#2fef10")), + ("bright light green", Rgba8::from_hex(b"#2dfe54")), + ("fluro green", Rgba8::from_hex(b"#0aff02")), + ("kiwi", Rgba8::from_hex(b"#9cef43")), + ("seaweed", Rgba8::from_hex(b"#18d17b")), + ("navy green", Rgba8::from_hex(b"#35530a")), + ("ultramarine blue", Rgba8::from_hex(b"#1805db")), + ("iris", Rgba8::from_hex(b"#6258c4")), + ("pastel orange", Rgba8::from_hex(b"#ff964f")), + ("yellowish orange", Rgba8::from_hex(b"#ffab0f")), + ("perrywinkle", Rgba8::from_hex(b"#8f8ce7")), + ("tealish", Rgba8::from_hex(b"#24bca8")), + ("dark plum", Rgba8::from_hex(b"#3f012c")), + ("pear", Rgba8::from_hex(b"#cbf85f")), + ("pinkish orange", Rgba8::from_hex(b"#ff724c")), + ("midnight purple", Rgba8::from_hex(b"#280137")), + ("light urple", Rgba8::from_hex(b"#b36ff6")), + ("dark mint", Rgba8::from_hex(b"#48c072")), + ("greenish tan", Rgba8::from_hex(b"#bccb7a")), + ("light burgundy", Rgba8::from_hex(b"#a8415b")), + ("turquoise blue", Rgba8::from_hex(b"#06b1c4")), + ("ugly pink", Rgba8::from_hex(b"#cd7584")), + ("sandy", Rgba8::from_hex(b"#f1da7a")), + ("electric pink", Rgba8::from_hex(b"#ff0490")), + ("muted purple", Rgba8::from_hex(b"#805b87")), + ("mid green", Rgba8::from_hex(b"#50a747")), + ("greyish", Rgba8::from_hex(b"#a8a495")), + ("neon yellow", Rgba8::from_hex(b"#cfff04")), + ("banana", Rgba8::from_hex(b"#ffff7e")), + ("carnation pink", Rgba8::from_hex(b"#ff7fa7")), + ("sea", Rgba8::from_hex(b"#3c9992")), + ("muddy brown", Rgba8::from_hex(b"#886806")), + ("turquoise green", Rgba8::from_hex(b"#04f489")), + ("buff", Rgba8::from_hex(b"#fef69e")), + ("fawn", Rgba8::from_hex(b"#cfaf7b")), + ("muted blue", Rgba8::from_hex(b"#3b719f")), + ("pale rose", Rgba8::from_hex(b"#fdc1c5")), + ("dark mint green", Rgba8::from_hex(b"#20c073")), + ("amethyst", Rgba8::from_hex(b"#9b5fc0")), + ("blue/green", Rgba8::from_hex(b"#0f9b8e")), + ("chestnut", Rgba8::from_hex(b"#742802")), + ("sick green", Rgba8::from_hex(b"#9db92c")), + ("pea", Rgba8::from_hex(b"#a4bf20")), + ("rusty orange", Rgba8::from_hex(b"#cd5909")), + ("stone", Rgba8::from_hex(b"#ada587")), + ("rose red", Rgba8::from_hex(b"#be013c")), + ("pale aqua", Rgba8::from_hex(b"#b8ffeb")), + ("deep orange", Rgba8::from_hex(b"#dc4d01")), + ("earth", Rgba8::from_hex(b"#a2653e")), + ("mossy green", Rgba8::from_hex(b"#638b27")), + ("grassy green", Rgba8::from_hex(b"#419c03")), + ("pale lime green", Rgba8::from_hex(b"#b1ff65")), + ("light grey blue", Rgba8::from_hex(b"#9dbcd4")), + ("pale grey", Rgba8::from_hex(b"#fdfdfe")), + ("asparagus", Rgba8::from_hex(b"#77ab56")), + ("blueberry", Rgba8::from_hex(b"#464196")), + ("purple red", Rgba8::from_hex(b"#990147")), + ("pale lime", Rgba8::from_hex(b"#befd73")), + ("greenish teal", Rgba8::from_hex(b"#32bf84")), + ("caramel", Rgba8::from_hex(b"#af6f09")), + ("deep magenta", Rgba8::from_hex(b"#a0025c")), + ("light peach", Rgba8::from_hex(b"#ffd8b1")), + ("milk chocolate", Rgba8::from_hex(b"#7f4e1e")), + ("ocher", Rgba8::from_hex(b"#bf9b0c")), + ("off green", Rgba8::from_hex(b"#6ba353")), + ("purply pink", Rgba8::from_hex(b"#f075e6")), + ("dusky blue", Rgba8::from_hex(b"#475f94")), + ("golden", Rgba8::from_hex(b"#f5bf03")), + ("light beige", Rgba8::from_hex(b"#fffeb6")), + ("butter yellow", Rgba8::from_hex(b"#fffd74")), + ("dusky purple", Rgba8::from_hex(b"#895b7b")), + ("french blue", Rgba8::from_hex(b"#436bad")), + ("ugly yellow", Rgba8::from_hex(b"#d0c101")), + ("greeny yellow", Rgba8::from_hex(b"#c6f808")), + ("orangish red", Rgba8::from_hex(b"#f43605")), + ("shamrock green", Rgba8::from_hex(b"#02c14d")), + ("orangish brown", Rgba8::from_hex(b"#b25f03")), + ("tree green", Rgba8::from_hex(b"#2a7e19")), + ("deep violet", Rgba8::from_hex(b"#490648")), + ("gunmetal", Rgba8::from_hex(b"#536267")), + ("blue/purple", Rgba8::from_hex(b"#5a06ef")), + ("cherry", Rgba8::from_hex(b"#cf0234")), + ("sandy brown", Rgba8::from_hex(b"#c4a661")), + ("warm grey", Rgba8::from_hex(b"#978a84")), + ("dark indigo", Rgba8::from_hex(b"#1f0954")), + ("midnight", Rgba8::from_hex(b"#03012d")), + ("bluey green", Rgba8::from_hex(b"#2bb179")), + ("grey pink", Rgba8::from_hex(b"#c3909b")), + ("soft purple", Rgba8::from_hex(b"#a66fb5")), + ("blood", Rgba8::from_hex(b"#770001")), + ("brown red", Rgba8::from_hex(b"#922b05")), + ("medium grey", Rgba8::from_hex(b"#7d7f7c")), + ("berry", Rgba8::from_hex(b"#990f4b")), + ("poo", Rgba8::from_hex(b"#8f7303")), + ("purpley pink", Rgba8::from_hex(b"#c83cb9")), + ("light salmon", Rgba8::from_hex(b"#fea993")), + ("snot", Rgba8::from_hex(b"#acbb0d")), + ("easter purple", Rgba8::from_hex(b"#c071fe")), + ("light yellow green", Rgba8::from_hex(b"#ccfd7f")), + ("dark navy blue", Rgba8::from_hex(b"#00022e")), + ("drab", Rgba8::from_hex(b"#828344")), + ("light rose", Rgba8::from_hex(b"#ffc5cb")), + ("rouge", Rgba8::from_hex(b"#ab1239")), + ("purplish red", Rgba8::from_hex(b"#b0054b")), + ("slime green", Rgba8::from_hex(b"#99cc04")), + ("baby poop", Rgba8::from_hex(b"#937c00")), + ("irish green", Rgba8::from_hex(b"#019529")), + ("pink/purple", Rgba8::from_hex(b"#ef1de7")), + ("dark navy", Rgba8::from_hex(b"#000435")), + ("greeny blue", Rgba8::from_hex(b"#42b395")), + ("light plum", Rgba8::from_hex(b"#9d5783")), + ("pinkish grey", Rgba8::from_hex(b"#c8aca9")), + ("dirty orange", Rgba8::from_hex(b"#c87606")), + ("rust red", Rgba8::from_hex(b"#aa2704")), + ("pale lilac", Rgba8::from_hex(b"#e4cbff")), + ("orangey red", Rgba8::from_hex(b"#fa4224")), + ("primary blue", Rgba8::from_hex(b"#0804f9")), + ("kermit green", Rgba8::from_hex(b"#5cb200")), + ("brownish purple", Rgba8::from_hex(b"#76424e")), + ("murky green", Rgba8::from_hex(b"#6c7a0e")), + ("very dark purple", Rgba8::from_hex(b"#2a0134")), + ("bottle green", Rgba8::from_hex(b"#044a05")), + ("watermelon", Rgba8::from_hex(b"#fd4659")), + ("deep sky blue", Rgba8::from_hex(b"#0d75f8")), + ("fire engine red", Rgba8::from_hex(b"#fe0002")), + ("yellow ochre", Rgba8::from_hex(b"#cb9d06")), + ("pumpkin orange", Rgba8::from_hex(b"#fb7d07")), + ("pale olive", Rgba8::from_hex(b"#b9cc81")), + ("light lilac", Rgba8::from_hex(b"#edc8ff")), + ("lightish green", Rgba8::from_hex(b"#61e160")), + ("carolina blue", Rgba8::from_hex(b"#8ab8fe")), + ("mulberry", Rgba8::from_hex(b"#920a4e")), + ("shocking pink", Rgba8::from_hex(b"#fe02a2")), + ("auburn", Rgba8::from_hex(b"#9a3001")), + ("bright lime green", Rgba8::from_hex(b"#65fe08")), + ("celadon", Rgba8::from_hex(b"#befdb7")), + ("pinkish brown", Rgba8::from_hex(b"#b17261")), + ("poo brown", Rgba8::from_hex(b"#885f01")), + ("bright sky blue", Rgba8::from_hex(b"#02ccfe")), + ("celery", Rgba8::from_hex(b"#c1fd95")), + ("dirt brown", Rgba8::from_hex(b"#836539")), + ("strawberry", Rgba8::from_hex(b"#fb2943")), + ("dark lime", Rgba8::from_hex(b"#84b701")), + ("copper", Rgba8::from_hex(b"#b66325")), + ("medium brown", Rgba8::from_hex(b"#7f5112")), + ("muted green", Rgba8::from_hex(b"#5fa052")), + ("robin's egg", Rgba8::from_hex(b"#6dedfd")), + ("bright aqua", Rgba8::from_hex(b"#0bf9ea")), + ("bright lavender", Rgba8::from_hex(b"#c760ff")), + ("very light purple", Rgba8::from_hex(b"#f6cefc")), + ("light navy", Rgba8::from_hex(b"#155084")), + ("pink red", Rgba8::from_hex(b"#f5054f")), + ("olive brown", Rgba8::from_hex(b"#645403")), + ("poop brown", Rgba8::from_hex(b"#7a5901")), + ("mustard green", Rgba8::from_hex(b"#a8b504")), + ("ocean green", Rgba8::from_hex(b"#3d9973")), + ("very dark blue", Rgba8::from_hex(b"#000133")), + ("dusty green", Rgba8::from_hex(b"#76a973")), + ("light navy blue", Rgba8::from_hex(b"#2e5a88")), + ("minty green", Rgba8::from_hex(b"#0bf77d")), + ("adobe", Rgba8::from_hex(b"#bd6c48")), + ("barney", Rgba8::from_hex(b"#ac1db8")), + ("jade green", Rgba8::from_hex(b"#2baf6a")), + ("bright light blue", Rgba8::from_hex(b"#26f7fd")), + ("light lime", Rgba8::from_hex(b"#aefd6c")), + ("dark khaki", Rgba8::from_hex(b"#9b8f55")), + ("orange yellow", Rgba8::from_hex(b"#ffad01")), + ("ocre", Rgba8::from_hex(b"#c69c04")), + ("maize", Rgba8::from_hex(b"#f4d054")), + ("faded pink", Rgba8::from_hex(b"#de9dac")), + ("british racing green", Rgba8::from_hex(b"#05480d")), + ("sandstone", Rgba8::from_hex(b"#c9ae74")), + ("mud brown", Rgba8::from_hex(b"#60460f")), + ("light sea green", Rgba8::from_hex(b"#98f6b0")), + ("robin egg blue", Rgba8::from_hex(b"#8af1fe")), + ("aqua marine", Rgba8::from_hex(b"#2ee8bb")), + ("dark sea green", Rgba8::from_hex(b"#11875d")), + ("soft pink", Rgba8::from_hex(b"#fdb0c0")), + ("orangey brown", Rgba8::from_hex(b"#b16002")), + ("cherry red", Rgba8::from_hex(b"#f7022a")), + ("burnt yellow", Rgba8::from_hex(b"#d5ab09")), + ("brownish grey", Rgba8::from_hex(b"#86775f")), + ("camel", Rgba8::from_hex(b"#c69f59")), + ("purplish grey", Rgba8::from_hex(b"#7a687f")), + ("marine", Rgba8::from_hex(b"#042e60")), + ("greyish pink", Rgba8::from_hex(b"#c88d94")), + ("pale turquoise", Rgba8::from_hex(b"#a5fbd5")), + ("pastel yellow", Rgba8::from_hex(b"#fffe71")), + ("bluey purple", Rgba8::from_hex(b"#6241c7")), + ("canary yellow", Rgba8::from_hex(b"#fffe40")), + ("faded red", Rgba8::from_hex(b"#d3494e")), + ("sepia", Rgba8::from_hex(b"#985e2b")), + ("coffee", Rgba8::from_hex(b"#a6814c")), + ("bright magenta", Rgba8::from_hex(b"#ff08e8")), + ("mocha", Rgba8::from_hex(b"#9d7651")), + ("ecru", Rgba8::from_hex(b"#feffca")), + ("purpleish", Rgba8::from_hex(b"#98568d")), + ("cranberry", Rgba8::from_hex(b"#9e003a")), + ("darkish green", Rgba8::from_hex(b"#287c37")), + ("brown orange", Rgba8::from_hex(b"#b96902")), + ("dusky rose", Rgba8::from_hex(b"#ba6873")), + ("melon", Rgba8::from_hex(b"#ff7855")), + ("sickly green", Rgba8::from_hex(b"#94b21c")), + ("purply blue", Rgba8::from_hex(b"#661aee")), + ("purpleish blue", Rgba8::from_hex(b"#6140ef")), + ("hospital green", Rgba8::from_hex(b"#9be5aa")), + ("shit brown", Rgba8::from_hex(b"#7b5804")), + ("mid blue", Rgba8::from_hex(b"#276ab3")), + ("amber", Rgba8::from_hex(b"#feb308")), + ("easter green", Rgba8::from_hex(b"#8cfd7e")), + ("soft blue", Rgba8::from_hex(b"#6488ea")), + ("cerulean blue", Rgba8::from_hex(b"#056eee")), + ("golden brown", Rgba8::from_hex(b"#b27a01")), + ("bright turquoise", Rgba8::from_hex(b"#0ffef9")), + ("red pink", Rgba8::from_hex(b"#fa2a55")), + ("red purple", Rgba8::from_hex(b"#820747")), + ("greyish brown", Rgba8::from_hex(b"#7a6a4f")), + ("vermillion", Rgba8::from_hex(b"#f4320c")), + ("russet", Rgba8::from_hex(b"#a13905")), + ("steel grey", Rgba8::from_hex(b"#6f828a")), + ("lighter purple", Rgba8::from_hex(b"#a55af4")), + ("bright violet", Rgba8::from_hex(b"#ad0afd")), + ("prussian blue", Rgba8::from_hex(b"#004577")), + ("slate green", Rgba8::from_hex(b"#658d6d")), + ("dirty pink", Rgba8::from_hex(b"#ca7b80")), + ("dark blue green", Rgba8::from_hex(b"#005249")), + ("pine", Rgba8::from_hex(b"#2b5d34")), + ("yellowy green", Rgba8::from_hex(b"#bff128")), + ("dark gold", Rgba8::from_hex(b"#b59410")), + ("bluish", Rgba8::from_hex(b"#2976bb")), + ("darkish blue", Rgba8::from_hex(b"#014182")), + ("dull red", Rgba8::from_hex(b"#bb3f3f")), + ("pinky red", Rgba8::from_hex(b"#fc2647")), + ("bronze", Rgba8::from_hex(b"#a87900")), + ("pale teal", Rgba8::from_hex(b"#82cbb2")), + ("military green", Rgba8::from_hex(b"#667c3e")), + ("barbie pink", Rgba8::from_hex(b"#fe46a5")), + ("bubblegum pink", Rgba8::from_hex(b"#fe83cc")), + ("pea soup green", Rgba8::from_hex(b"#94a617")), + ("dark mustard", Rgba8::from_hex(b"#a88905")), + ("shit", Rgba8::from_hex(b"#7f5f00")), + ("medium purple", Rgba8::from_hex(b"#9e43a2")), + ("very dark green", Rgba8::from_hex(b"#062e03")), + ("dirt", Rgba8::from_hex(b"#8a6e45")), + ("dusky pink", Rgba8::from_hex(b"#cc7a8b")), + ("red violet", Rgba8::from_hex(b"#9e0168")), + ("lemon yellow", Rgba8::from_hex(b"#fdff38")), + ("pistachio", Rgba8::from_hex(b"#c0fa8b")), + ("dull yellow", Rgba8::from_hex(b"#eedc5b")), + ("dark lime green", Rgba8::from_hex(b"#7ebd01")), + ("denim blue", Rgba8::from_hex(b"#3b5b92")), + ("teal blue", Rgba8::from_hex(b"#01889f")), + ("lightish blue", Rgba8::from_hex(b"#3d7afd")), + ("purpley blue", Rgba8::from_hex(b"#5f34e7")), + ("light indigo", Rgba8::from_hex(b"#6d5acf")), + ("swamp green", Rgba8::from_hex(b"#748500")), + ("brown green", Rgba8::from_hex(b"#706c11")), + ("dark maroon", Rgba8::from_hex(b"#3c0008")), + ("hot purple", Rgba8::from_hex(b"#cb00f5")), + ("dark forest green", Rgba8::from_hex(b"#002d04")), + ("faded blue", Rgba8::from_hex(b"#658cbb")), + ("drab green", Rgba8::from_hex(b"#749551")), + ("light lime green", Rgba8::from_hex(b"#b9ff66")), + ("snot green", Rgba8::from_hex(b"#9dc100")), + ("yellowish", Rgba8::from_hex(b"#faee66")), + ("light blue green", Rgba8::from_hex(b"#7efbb3")), + ("bordeaux", Rgba8::from_hex(b"#7b002c")), + ("light mauve", Rgba8::from_hex(b"#c292a1")), + ("ocean", Rgba8::from_hex(b"#017b92")), + ("marigold", Rgba8::from_hex(b"#fcc006")), + ("muddy green", Rgba8::from_hex(b"#657432")), + ("dull orange", Rgba8::from_hex(b"#d8863b")), + ("steel", Rgba8::from_hex(b"#738595")), + ("electric purple", Rgba8::from_hex(b"#aa23ff")), + ("fluorescent green", Rgba8::from_hex(b"#08ff08")), + ("yellowish brown", Rgba8::from_hex(b"#9b7a01")), + ("blush", Rgba8::from_hex(b"#f29e8e")), + ("soft green", Rgba8::from_hex(b"#6fc276")), + ("bright orange", Rgba8::from_hex(b"#ff5b00")), + ("lemon", Rgba8::from_hex(b"#fdff52")), + ("purple grey", Rgba8::from_hex(b"#866f85")), + ("acid green", Rgba8::from_hex(b"#8ffe09")), + ("pale lavender", Rgba8::from_hex(b"#eecffe")), + ("violet blue", Rgba8::from_hex(b"#510ac9")), + ("light forest green", Rgba8::from_hex(b"#4f9153")), + ("burnt red", Rgba8::from_hex(b"#9f2305")), + ("khaki green", Rgba8::from_hex(b"#728639")), + ("cerise", Rgba8::from_hex(b"#de0c62")), + ("faded purple", Rgba8::from_hex(b"#916e99")), + ("apricot", Rgba8::from_hex(b"#ffb16d")), + ("dark olive green", Rgba8::from_hex(b"#3c4d03")), + ("grey brown", Rgba8::from_hex(b"#7f7053")), + ("green grey", Rgba8::from_hex(b"#77926f")), + ("true blue", Rgba8::from_hex(b"#010fcc")), + ("pale violet", Rgba8::from_hex(b"#ceaefa")), + ("periwinkle blue", Rgba8::from_hex(b"#8f99fb")), + ("light sky blue", Rgba8::from_hex(b"#c6fcff")), + ("blurple", Rgba8::from_hex(b"#5539cc")), + ("green brown", Rgba8::from_hex(b"#544e03")), + ("bluegreen", Rgba8::from_hex(b"#017a79")), + ("bright teal", Rgba8::from_hex(b"#01f9c6")), + ("brownish yellow", Rgba8::from_hex(b"#c9b003")), + ("pea soup", Rgba8::from_hex(b"#929901")), + ("forest", Rgba8::from_hex(b"#0b5509")), + ("barney purple", Rgba8::from_hex(b"#a00498")), + ("ultramarine", Rgba8::from_hex(b"#2000b1")), + ("purplish", Rgba8::from_hex(b"#94568c")), + ("puke yellow", Rgba8::from_hex(b"#c2be0e")), + ("bluish grey", Rgba8::from_hex(b"#748b97")), + ("dark periwinkle", Rgba8::from_hex(b"#665fd1")), + ("dark lilac", Rgba8::from_hex(b"#9c6da5")), + ("reddish", Rgba8::from_hex(b"#c44240")), + ("light maroon", Rgba8::from_hex(b"#a24857")), + ("dusty purple", Rgba8::from_hex(b"#825f87")), + ("terra cotta", Rgba8::from_hex(b"#c9643b")), + ("avocado", Rgba8::from_hex(b"#90b134")), + ("marine blue", Rgba8::from_hex(b"#01386a")), + ("teal green", Rgba8::from_hex(b"#25a36f")), + ("slate grey", Rgba8::from_hex(b"#59656d")), + ("lighter green", Rgba8::from_hex(b"#75fd63")), + ("electric green", Rgba8::from_hex(b"#21fc0d")), + ("dusty blue", Rgba8::from_hex(b"#5a86ad")), + ("golden yellow", Rgba8::from_hex(b"#fec615")), + ("bright yellow", Rgba8::from_hex(b"#fffd01")), + ("light lavender", Rgba8::from_hex(b"#dfc5fe")), + ("umber", Rgba8::from_hex(b"#b26400")), + ("poop", Rgba8::from_hex(b"#7f5e00")), + ("dark peach", Rgba8::from_hex(b"#de7e5d")), + ("jungle green", Rgba8::from_hex(b"#048243")), + ("eggshell", Rgba8::from_hex(b"#ffffd4")), + ("denim", Rgba8::from_hex(b"#3b638c")), + ("yellow brown", Rgba8::from_hex(b"#b79400")), + ("dull purple", Rgba8::from_hex(b"#84597e")), + ("chocolate brown", Rgba8::from_hex(b"#411900")), + ("wine red", Rgba8::from_hex(b"#7b0323")), + ("neon blue", Rgba8::from_hex(b"#04d9ff")), + ("dirty green", Rgba8::from_hex(b"#667e2c")), + ("light tan", Rgba8::from_hex(b"#fbeeac")), + ("ice blue", Rgba8::from_hex(b"#d7fffe")), + ("cadet blue", Rgba8::from_hex(b"#4e7496")), + ("dark mauve", Rgba8::from_hex(b"#874c62")), + ("very light blue", Rgba8::from_hex(b"#d5ffff")), + ("grey purple", Rgba8::from_hex(b"#826d8c")), + ("pastel pink", Rgba8::from_hex(b"#ffbacd")), + ("very light green", Rgba8::from_hex(b"#d1ffbd")), + ("dark sky blue", Rgba8::from_hex(b"#448ee4")), + ("evergreen", Rgba8::from_hex(b"#05472a")), + ("dull pink", Rgba8::from_hex(b"#d5869d")), + ("aubergine", Rgba8::from_hex(b"#3d0734")), + ("mahogany", Rgba8::from_hex(b"#4a0100")), + ("reddish orange", Rgba8::from_hex(b"#f8481c")), + ("deep green", Rgba8::from_hex(b"#02590f")), + ("vomit green", Rgba8::from_hex(b"#89a203")), + ("purple pink", Rgba8::from_hex(b"#e03fd8")), + ("dusty pink", Rgba8::from_hex(b"#d58a94")), + ("faded green", Rgba8::from_hex(b"#7bb274")), + ("camo green", Rgba8::from_hex(b"#526525")), + ("pinky purple", Rgba8::from_hex(b"#c94cbe")), + ("pink purple", Rgba8::from_hex(b"#db4bda")), + ("brownish red", Rgba8::from_hex(b"#9e3623")), + ("dark rose", Rgba8::from_hex(b"#b5485d")), + ("mud", Rgba8::from_hex(b"#735c12")), + ("brownish", Rgba8::from_hex(b"#9c6d57")), + ("emerald green", Rgba8::from_hex(b"#028f1e")), + ("pale brown", Rgba8::from_hex(b"#b1916e")), + ("dull blue", Rgba8::from_hex(b"#49759c")), + ("burnt umber", Rgba8::from_hex(b"#a0450e")), + ("medium green", Rgba8::from_hex(b"#39ad48")), + ("clay", Rgba8::from_hex(b"#b66a50")), + ("light aqua", Rgba8::from_hex(b"#8cffdb")), + ("light olive green", Rgba8::from_hex(b"#a4be5c")), + ("brownish orange", Rgba8::from_hex(b"#cb7723")), + ("dark aqua", Rgba8::from_hex(b"#05696b")), + ("purplish pink", Rgba8::from_hex(b"#ce5dae")), + ("dark salmon", Rgba8::from_hex(b"#c85a53")), + ("greenish grey", Rgba8::from_hex(b"#96ae8d")), + ("jade", Rgba8::from_hex(b"#1fa774")), + ("ugly green", Rgba8::from_hex(b"#7a9703")), + ("dark beige", Rgba8::from_hex(b"#ac9362")), + ("emerald", Rgba8::from_hex(b"#01a049")), + ("pale red", Rgba8::from_hex(b"#d9544d")), + ("light magenta", Rgba8::from_hex(b"#fa5ff7")), + ("sky", Rgba8::from_hex(b"#82cafc")), + ("light cyan", Rgba8::from_hex(b"#acfffc")), + ("yellow orange", Rgba8::from_hex(b"#fcb001")), + ("reddish purple", Rgba8::from_hex(b"#910951")), + ("reddish pink", Rgba8::from_hex(b"#fe2c54")), + ("dirty yellow", Rgba8::from_hex(b"#cdc50a")), + ("orange red", Rgba8::from_hex(b"#fd411e")), + ("deep red", Rgba8::from_hex(b"#9a0200")), + ("orange brown", Rgba8::from_hex(b"#be6400")), + ("cobalt blue", Rgba8::from_hex(b"#030aa7")), + ("neon pink", Rgba8::from_hex(b"#fe019a")), + ("rose pink", Rgba8::from_hex(b"#f7879a")), + ("greyish purple", Rgba8::from_hex(b"#887191")), + ("raspberry", Rgba8::from_hex(b"#b00149")), + ("aqua green", Rgba8::from_hex(b"#12e193")), + ("salmon pink", Rgba8::from_hex(b"#fe7b7c")), + ("tangerine", Rgba8::from_hex(b"#ff9408")), + ("brownish green", Rgba8::from_hex(b"#6a6e09")), + ("red brown", Rgba8::from_hex(b"#8b2e16")), + ("greenish brown", Rgba8::from_hex(b"#696112")), + ("pumpkin", Rgba8::from_hex(b"#e17701")), + ("pine green", Rgba8::from_hex(b"#0a481e")), + ("charcoal", Rgba8::from_hex(b"#343837")), + ("baby pink", Rgba8::from_hex(b"#ffb7ce")), + ("cornflower", Rgba8::from_hex(b"#6a79f7")), + ("blue violet", Rgba8::from_hex(b"#5d06e9")), + ("greyish green", Rgba8::from_hex(b"#82a67d")), + ("scarlet", Rgba8::from_hex(b"#be0119")), + ("green yellow", Rgba8::from_hex(b"#c9ff27")), + ("dark olive", Rgba8::from_hex(b"#373e02")), + ("pastel purple", Rgba8::from_hex(b"#caa0ff")), + ("terracotta", Rgba8::from_hex(b"#ca6641")), + ("aqua blue", Rgba8::from_hex(b"#02d8e9")), + ("sage green", Rgba8::from_hex(b"#88b378")), + ("blood red", Rgba8::from_hex(b"#980002")), + ("deep pink", Rgba8::from_hex(b"#cb0162")), + ("grass", Rgba8::from_hex(b"#5cac2d")), + ("moss", Rgba8::from_hex(b"#769958")), + ("pastel blue", Rgba8::from_hex(b"#a2bffe")), + ("bluish green", Rgba8::from_hex(b"#10a674")), + ("green blue", Rgba8::from_hex(b"#06b48b")), + ("dark tan", Rgba8::from_hex(b"#af884a")), + ("greenish blue", Rgba8::from_hex(b"#0b8b87")), + ("pale orange", Rgba8::from_hex(b"#ffa756")), + ("vomit", Rgba8::from_hex(b"#a2a415")), + ("forrest green", Rgba8::from_hex(b"#154406")), + ("dark lavender", Rgba8::from_hex(b"#856798")), + ("dark violet", Rgba8::from_hex(b"#34013f")), + ("purple blue", Rgba8::from_hex(b"#632de9")), + ("dark cyan", Rgba8::from_hex(b"#0a888a")), + ("olive drab", Rgba8::from_hex(b"#6f7632")), + ("pinkish", Rgba8::from_hex(b"#d46a7e")), + ("cobalt", Rgba8::from_hex(b"#1e488f")), + ("neon purple", Rgba8::from_hex(b"#bc13fe")), + ("light turquoise", Rgba8::from_hex(b"#7ef4cc")), + ("apple green", Rgba8::from_hex(b"#76cd26")), + ("dull green", Rgba8::from_hex(b"#74a662")), + ("wine", Rgba8::from_hex(b"#80013f")), + ("powder blue", Rgba8::from_hex(b"#b1d1fc")), + ("off white", Rgba8::from_hex(b"#ffffe4")), + ("electric blue", Rgba8::from_hex(b"#0652ff")), + ("dark turquoise", Rgba8::from_hex(b"#045c5a")), + ("blue purple", Rgba8::from_hex(b"#5729ce")), + ("bright red", Rgba8::from_hex(b"#ff000d")), + ("pinkish red", Rgba8::from_hex(b"#f10c45")), + ("cornflower blue", Rgba8::from_hex(b"#5170d7")), + ("light olive", Rgba8::from_hex(b"#acbf69")), + ("grape", Rgba8::from_hex(b"#6c3461")), + ("greyish blue", Rgba8::from_hex(b"#5e819d")), + ("purplish blue", Rgba8::from_hex(b"#601ef9")), + ("yellowish green", Rgba8::from_hex(b"#b0dd16")), + ("greenish yellow", Rgba8::from_hex(b"#cdfd02")), + ("medium blue", Rgba8::from_hex(b"#2c6fbb")), + ("dusty rose", Rgba8::from_hex(b"#c0737a")), + ("light violet", Rgba8::from_hex(b"#d6b4fc")), + ("midnight blue", Rgba8::from_hex(b"#020035")), + ("bluish purple", Rgba8::from_hex(b"#703be7")), + ("red orange", Rgba8::from_hex(b"#fd3c06")), + ("dark magenta", Rgba8::from_hex(b"#960056")), + ("greenish", Rgba8::from_hex(b"#40a368")), + ("ocean blue", Rgba8::from_hex(b"#03719c")), + ("cream", Rgba8::from_hex(b"#ffffc2")), + ("reddish brown", Rgba8::from_hex(b"#7f2b0a")), + ("burnt sienna", Rgba8::from_hex(b"#b04e0f")), + ("brick", Rgba8::from_hex(b"#a03623")), + ("sage", Rgba8::from_hex(b"#87ae73")), + ("grey green", Rgba8::from_hex(b"#789b73")), + ("robin's egg blue", Rgba8::from_hex(b"#98eff9")), + ("moss green", Rgba8::from_hex(b"#658b38")), + ("steel blue", Rgba8::from_hex(b"#5a7d9a")), + ("eggplant", Rgba8::from_hex(b"#380835")), + ("light yellow", Rgba8::from_hex(b"#fffe7a")), + ("leaf green", Rgba8::from_hex(b"#5ca904")), + ("light grey", Rgba8::from_hex(b"#d8dcd6")), + ("puke", Rgba8::from_hex(b"#a5a502")), + ("pinkish purple", Rgba8::from_hex(b"#d648d7")), + ("sea blue", Rgba8::from_hex(b"#047495")), + ("pale purple", Rgba8::from_hex(b"#b790d4")), + ("slate blue", Rgba8::from_hex(b"#5b7c99")), + ("blue grey", Rgba8::from_hex(b"#607c8e")), + ("hunter green", Rgba8::from_hex(b"#0b4008")), + ("pale yellow", Rgba8::from_hex(b"#ffff84")), + ("ochre", Rgba8::from_hex(b"#bf9005")), + ("mustard yellow", Rgba8::from_hex(b"#d2bd0a")), + ("light red", Rgba8::from_hex(b"#ff474c")), + ("cerulean", Rgba8::from_hex(b"#0485d1")), + ("pale pink", Rgba8::from_hex(b"#ffcfdc")), + ("deep blue", Rgba8::from_hex(b"#040273")), + ("rust", Rgba8::from_hex(b"#a83c09")), + ("light teal", Rgba8::from_hex(b"#90e4c1")), + ("slate", Rgba8::from_hex(b"#516572")), + ("dark yellow", Rgba8::from_hex(b"#d5b60a")), + ("dark grey", Rgba8::from_hex(b"#363737")), + ("army green", Rgba8::from_hex(b"#4b5d16")), + ("grey blue", Rgba8::from_hex(b"#6b8ba4")), + ("seafoam", Rgba8::from_hex(b"#80f9ad")), + ("puce", Rgba8::from_hex(b"#a57e52")), + ("spring green", Rgba8::from_hex(b"#a9f971")), + ("dark orange", Rgba8::from_hex(b"#c65102")), + ("sand", Rgba8::from_hex(b"#e2ca76")), + ("pastel green", Rgba8::from_hex(b"#b0ff9d")), + ("mint", Rgba8::from_hex(b"#9ffeb0")), + ("light orange", Rgba8::from_hex(b"#fdaa48")), + ("bright pink", Rgba8::from_hex(b"#fe01b1")), + ("deep purple", Rgba8::from_hex(b"#36013f")), + ("dark brown", Rgba8::from_hex(b"#341c02")), + ("taupe", Rgba8::from_hex(b"#b9a281")), + ("pea green", Rgba8::from_hex(b"#8eab12")), + ("puke green", Rgba8::from_hex(b"#9aae07")), + ("kelly green", Rgba8::from_hex(b"#02ab2e")), + ("seafoam green", Rgba8::from_hex(b"#7af9ab")), + ("blue green", Rgba8::from_hex(b"#137e6d")), + ("burgundy", Rgba8::from_hex(b"#610023")), + ("dark teal", Rgba8::from_hex(b"#014d4e")), + ("brick red", Rgba8::from_hex(b"#8f1402")), + ("royal purple", Rgba8::from_hex(b"#4b006e")), + ("mint green", Rgba8::from_hex(b"#8fff9f")), + ("baby blue", Rgba8::from_hex(b"#a2cffe")), + ("yellow green", Rgba8::from_hex(b"#c0fb2d")), + ("bright purple", Rgba8::from_hex(b"#be03fd")), + ("dark red", Rgba8::from_hex(b"#840000")), + ("pale blue", Rgba8::from_hex(b"#d0fefe")), + ("grass green", Rgba8::from_hex(b"#3f9b0b")), + ("burnt orange", Rgba8::from_hex(b"#c04e01")), + ("neon green", Rgba8::from_hex(b"#0cff0c")), + ("bright blue", Rgba8::from_hex(b"#0165fc")), + ("rose", Rgba8::from_hex(b"#cf6275")), + ("light pink", Rgba8::from_hex(b"#ffd1df")), + ("mustard", Rgba8::from_hex(b"#ceb301")), + ("sea green", Rgba8::from_hex(b"#53fca1")), + ("periwinkle", Rgba8::from_hex(b"#8e82fe")), + ("dark pink", Rgba8::from_hex(b"#cb416b")), + ("olive green", Rgba8::from_hex(b"#677a04")), + ("peach", Rgba8::from_hex(b"#ffb07c")), + ("pale green", Rgba8::from_hex(b"#c7fdb5")), + ("light brown", Rgba8::from_hex(b"#ad8150")), + ("hot pink", Rgba8::from_hex(b"#ff028d")), + ("lilac", Rgba8::from_hex(b"#cea2fd")), + ("navy blue", Rgba8::from_hex(b"#001146")), + ("royal blue", Rgba8::from_hex(b"#0504aa")), + ("bright green", Rgba8::from_hex(b"#01ff07")), + ("dark purple", Rgba8::from_hex(b"#35063e")), + ("mauve", Rgba8::from_hex(b"#ae7181")), + ("forest green", Rgba8::from_hex(b"#06470c")), + ("dark blue", Rgba8::from_hex(b"#00035b")), + ("dark green", Rgba8::from_hex(b"#033500")), + ("light purple", Rgba8::from_hex(b"#bf77f6")), + ("lime green", Rgba8::from_hex(b"#89fe05")), + ("sky blue", Rgba8::from_hex(b"#75bbfd")), + ("light green", Rgba8::from_hex(b"#96f97b")), + ("light blue", Rgba8::from_hex(b"#95d0fc")), +]; diff --git a/base/src/geom.rs b/base/src/geom.rs index f322d0d4..fcbff2a1 100644 --- a/base/src/geom.rs +++ b/base/src/geom.rs @@ -410,27 +410,27 @@ impl Rect { } /// Padding within a graphical element -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub enum Padding { /// Uniform padding in all directions Even(f32), /// Vertical and horizontal padding Center { /// Vertical padding - v: f32, + ver: f32, /// Horizontal padding - h: f32, + hor: f32, }, /// Top, right, bottom and left padding Custom { /// Top padding - t: f32, + top: f32, /// Right padding - r: f32, + right: f32, /// Bottom padding - b: f32, + bottom: f32, /// Left padding - l: f32, + left: f32, }, } @@ -439,8 +439,8 @@ impl Padding { pub const fn top(&self) -> f32 { match self { Padding::Even(p) => *p, - Padding::Center { v, .. } => *v, - Padding::Custom { t, .. } => *t, + Padding::Center { ver: v, .. } => *v, + Padding::Custom { top: t, .. } => *t, } } @@ -448,8 +448,8 @@ impl Padding { pub const fn right(&self) -> f32 { match self { Padding::Even(p) => *p, - Padding::Center { h, .. } => *h, - Padding::Custom { r, .. } => *r, + Padding::Center { hor: h, .. } => *h, + Padding::Custom { right: r, .. } => *r, } } @@ -457,8 +457,8 @@ impl Padding { pub const fn bottom(&self) -> f32 { match self { Padding::Even(p) => *p, - Padding::Center { v, .. } => *v, - Padding::Custom { b, .. } => *b, + Padding::Center { ver: v, .. } => *v, + Padding::Custom { bottom: b, .. } => *b, } } @@ -466,8 +466,8 @@ impl Padding { pub const fn left(&self) -> f32 { match self { Padding::Even(p) => *p, - Padding::Center { h, .. } => *h, - Padding::Custom { l, .. } => *l, + Padding::Center { hor: h, .. } => *h, + Padding::Custom { left: l, .. } => *l, } } @@ -475,8 +475,10 @@ impl Padding { pub const fn sum_ver(&self) -> f32 { match self { Padding::Even(p) => *p * 2.0, - Padding::Center { v, .. } => *v * 2.0, - Padding::Custom { t, b, .. } => *t + *b, + Padding::Center { ver: v, .. } => *v * 2.0, + Padding::Custom { + top: t, bottom: b, .. + } => *t + *b, } } @@ -484,8 +486,10 @@ impl Padding { pub const fn sum_hor(&self) -> f32 { match self { Padding::Even(p) => *p * 2.0, - Padding::Center { h, .. } => *h * 2.0, - Padding::Custom { l, r, .. } => *l + *r, + Padding::Center { hor: h, .. } => *h * 2.0, + Padding::Custom { + left: l, right: r, .. + } => *l + *r, } } } @@ -498,13 +502,18 @@ impl From for Padding { impl From<(f32, f32)> for Padding { fn from((v, h): (f32, f32)) -> Self { - Padding::Center { v, h } + Padding::Center { ver: v, hor: h } } } impl From<(f32, f32, f32, f32)> for Padding { fn from((t, r, b, l): (f32, f32, f32, f32)) -> Self { - Padding::Custom { t, r, b, l } + Padding::Custom { + top: t, + right: r, + bottom: b, + left: l, + } } } diff --git a/base/src/lib.rs b/base/src/lib.rs index cafcec17..4dbda7d5 100644 --- a/base/src/lib.rs +++ b/base/src/lib.rs @@ -2,3 +2,6 @@ pub mod color; pub use color::{Color, ResolveColor, Rgb8, Rgba8}; pub mod geom; + +#[cfg(feature = "serde")] +mod sd; diff --git a/base/src/sd.rs b/base/src/sd.rs new file mode 100644 index 00000000..775ce00d --- /dev/null +++ b/base/src/sd.rs @@ -0,0 +1,455 @@ +use std::borrow::Cow; +use std::collections::HashMap; +use std::fmt; +use std::sync::LazyLock; + +use crate::color::{css4, xkcd}; +use crate::geom::{Padding, Size}; +use crate::{Rgb8, Rgba8, geom}; + +static INVERSE_COLOR_MAP: LazyLock> = LazyLock::new(|| { + let mut map = HashMap::with_capacity(xkcd::COLORS.len() + css4::COLORS.len()); + map.extend(xkcd::COLORS.iter().map(|(name, rgba)| (*rgba, *name))); + map.extend(css4::COLORS.iter().map(|(name, rgba)| (*rgba, *name))); + map +}); + +impl serde::Serialize for Rgb8 { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + if let Some(name) = INVERSE_COLOR_MAP.get(&self.opaque()) { + name.serialize(serializer) + } else { + self.html().serialize(serializer) + } + } +} + +impl serde::Serialize for Rgba8 { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + if let Some(name) = INVERSE_COLOR_MAP.get(self) { + name.serialize(serializer) + } else { + self.html().serialize(serializer) + } + } +} +struct ColorSeqVisitor; + +impl<'de> serde::de::Visitor<'de> for ColorSeqVisitor { + type Value = Vec; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a color string or an RGB/RGBA tuple") + } + + fn visit_str(self, value: &str) -> Result + where + E: serde::de::Error, + { + let rgba = value.parse::().map_err(E::custom)?; + Ok(vec![rgba.r(), rgba.g(), rgba.b(), rgba.a()]) + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + let mut values = Vec::with_capacity(seq.size_hint().unwrap_or(4)); + while let Some(v) = seq.next_element::()? { + values.push(v); + } + match values.len() { + 3 | 4 => Ok(values), + len => Err(serde::de::Error::invalid_length(len, &self)), + } + } +} + +impl<'de> serde::Deserialize<'de> for Rgb8 { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let values = deserializer.deserialize_any(ColorSeqVisitor)?; + match values.as_slice() { + [r, g, b] => Ok(Rgb8::new(*r, *g, *b)), + [r, g, b, a] if *a == 255 => Ok(Rgb8::new(*r, *g, *b)), + [..] => Err(serde::de::Error::custom( + "RGB colors cannot include a non-opaque alpha component", + )), + } + } +} + +impl<'de> serde::Deserialize<'de> for Rgba8 { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let values = deserializer.deserialize_any(ColorSeqVisitor)?; + match values.as_slice() { + [r, g, b] => Ok(Rgba8::new(*r, *g, *b, 255)), + [r, g, b, a] => Ok(Rgba8::new(*r, *g, *b, *a)), + _ => unreachable!(), + } + } +} + +impl serde::Serialize for geom::Size { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + (self.width(), self.height()).serialize(serializer) + } +} + +impl<'de> serde::Deserialize<'de> for geom::Size { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + struct SizeVisitor; + + impl<'de> serde::de::Visitor<'de> for SizeVisitor { + type Value = Size; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a [width, height] tuple or an object { width, height }") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + let width = seq + .next_element::()? + .ok_or_else(|| serde::de::Error::invalid_length(0, &self))?; + let height = seq + .next_element::()? + .ok_or_else(|| serde::de::Error::invalid_length(1, &self))?; + Ok(Size::new(width, height)) + } + + fn visit_map(self, mut map: A) -> Result + where + A: serde::de::MapAccess<'de>, + { + let mut width = None::; + let mut height = None::; + + while let Some(key) = map.next_key::>()? { + match key.as_ref() { + "width" => { + if width.is_some() { + let _: f32 = map.next_value()?; + return Err(serde::de::Error::duplicate_field("width")); + } + width = Some(map.next_value()?); + } + "height" => { + if height.is_some() { + let _: f32 = map.next_value()?; + return Err(serde::de::Error::duplicate_field("height")); + } + height = Some(map.next_value()?); + } + _ => { + return Err(serde::de::Error::unknown_field( + key.as_ref(), + &["width", "height"], + )); + } + } + } + + Ok(Size::new( + width.ok_or_else(|| serde::de::Error::missing_field("width"))?, + height.ok_or_else(|| serde::de::Error::missing_field("height"))?, + )) + } + } + + deserializer.deserialize_any(SizeVisitor) + } +} + +impl serde::Serialize for geom::Padding { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + geom::Padding::Even(p) => p.serialize(serializer), + geom::Padding::Center { ver, hor } => (ver, hor).serialize(serializer), + geom::Padding::Custom { + top, + right, + bottom, + left, + } => (top, right, bottom, left).serialize(serializer), + } + } +} + +impl<'de> serde::Deserialize<'de> for Padding { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + struct PaddingVisitor; + + impl<'de> serde::de::Visitor<'de> for PaddingVisitor { + type Value = Padding; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a single float for even padding, a tuple of two floats for center padding, or a tuple of four floats for custom padding") + } + + fn visit_i64(self, value: i64) -> Result + where + E: serde::de::Error, + { + Ok(Padding::Even(value as f32)) + } + + fn visit_u64(self, value: u64) -> Result + where + E: serde::de::Error, + { + Ok(Padding::Even(value as f32)) + } + + fn visit_f32(self, value: f32) -> Result + where + E: serde::de::Error, + { + Ok(Padding::Even(value)) + } + + fn visit_f64(self, value: f64) -> Result + where + E: serde::de::Error, + { + Ok(Padding::Even(value as f32)) + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + let first = seq + .next_element::()? + .ok_or_else(|| serde::de::Error::invalid_length(0, &self))?; + let second = seq + .next_element::()? + .ok_or_else(|| serde::de::Error::invalid_length(1, &self))?; + + if let Some(third) = seq.next_element::()? { + let fourth = seq + .next_element::()? + .ok_or_else(|| serde::de::Error::invalid_length(3, &self))?; + Ok(Padding::Custom { + top: first, + right: second, + bottom: third, + left: fourth, + }) + } else { + Ok(Padding::Center { + ver: first, + hor: second, + }) + } + } + + fn visit_map(self, mut map: A) -> Result + where + A: serde::de::MapAccess<'de>, + { + let mut ver = None::; + let mut hor = None::; + let mut top = None::; + let mut right = None::; + let mut bottom = None::; + let mut left = None::; + + while let Some(field) = map.next_key::>()? { + match &*field { + "ver" => { + ver = Some(map.next_value()?); + } + "hor" => { + hor = Some(map.next_value()?); + } + "top" => top = Some(map.next_value()?), + "right" => right = Some(map.next_value()?), + "bottom" => bottom = Some(map.next_value()?), + "left" => left = Some(map.next_value()?), + _ => { + return Err(serde::de::Error::unknown_field( + &field, + &["ver", "hor", "top", "right", "bottom", "left"], + )); + } + } + } + + match (ver, hor, top, right, bottom, left) { + (Some(ver), Some(hor), None, None, None, None) => { + Ok(geom::Padding::Center { ver, hor }) + } + (None, None, Some(top), Some(right), Some(bottom), Some(left)) => { + Ok(geom::Padding::Custom { + top, + right, + bottom, + left, + }) + } + _ => Err(serde::de::Error::custom( + "Expected either a tuple of two floats for center padding or a tuple of four floats for custom padding", + )), + } + } + } + + deserializer.deserialize_any(PaddingVisitor) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_color_ser() { + let color = Rgba8::new(255, 0, 0, 255); + let serialized = serde_json::to_string(&color).unwrap(); + assert_eq!(serialized, "\"red\""); + + let color = "antiquewhite".parse::().unwrap(); + let serialized = serde_json::to_string(&color).unwrap(); + assert_eq!(serialized, "\"antiquewhite\""); + + let color = Rgba8::new(0x12, 0x34, 0x56, 0xff); + let serialized = serde_json::to_string(&color).unwrap(); + assert_eq!(serialized, "\"#123456\""); + + let color = Rgba8::new(0x12, 0x34, 0x56, 0); + let serialized = serde_json::to_string(&color).unwrap(); + assert_eq!(serialized, "\"rgba(18, 52, 86, 0)\""); + } + + #[test] + fn test_color_deser() { + let json = "\"red\""; + let deserialized: Rgba8 = serde_json::from_str(json).unwrap(); + assert_eq!(deserialized, Rgba8::new(255, 0, 0, 255)); + + let json = "\"#123456\""; + let deserialized: Rgba8 = serde_json::from_str(json).unwrap(); + assert_eq!(deserialized, Rgba8::new(0x12, 0x34, 0x56, 255)); + + let json = "\"rgba(18, 52, 86, 0)\""; + let deserialized: Rgba8 = serde_json::from_str(json).unwrap(); + assert_eq!(deserialized, Rgba8::new(0x12, 0x34, 0x56, 0)); + + let json = "[18, 52, 86]"; + let deserialized: Rgba8 = serde_json::from_str(json).unwrap(); + assert_eq!(deserialized, Rgba8::new(0x12, 0x34, 0x56, 255)); + } + + #[test] + fn test_size_ser() { + let size = Size::new(100.0, 200.0); + let serialized = serde_json::to_string(&size).unwrap(); + assert_eq!(serialized, "[100.0,200.0]"); + } + + #[test] + fn test_size_deser() { + let json = "[100.0, 200.0]"; + let deserialized: Size = serde_json::from_str(json).unwrap(); + assert_eq!(deserialized, Size::new(100.0, 200.0)); + let json = r#"{"width": 100.0, "height": 200.0}"#; + let deserialized: Size = serde_json::from_str(json).unwrap(); + assert_eq!(deserialized, Size::new(100.0, 200.0)); + } + + #[test] + fn test_padding_ser() { + let tests = vec![ + (Padding::Even(10.0), "10.0"), + ( + Padding::Center { + ver: 5.0, + hor: 15.0, + }, + "[5.0,15.0]", + ), + ( + Padding::Custom { + top: 1.0, + right: 2.0, + bottom: 3.0, + left: 4.0, + }, + "[1.0,2.0,3.0,4.0]", + ), + ]; + for (padding, expected) in tests { + let serialized = serde_json::to_string(&padding).unwrap(); + assert_eq!(serialized, expected); + } + } + + #[test] + fn test_padding_deser() { + let tests = vec![ + ("10.0", Padding::Even(10.0)), + ( + "[5.0, 15.0]", + Padding::Center { + ver: 5.0, + hor: 15.0, + }, + ), + ( + "[1.0, 2.0, 3.0, 4.0]", + Padding::Custom { + top: 1.0, + right: 2.0, + bottom: 3.0, + left: 4.0, + }, + ), + ( + r#"{"ver": 5.0, "hor": 15.0}"#, + Padding::Center { + ver: 5.0, + hor: 15.0, + }, + ), + ( + r#"{"top": 1.0, "right": 2.0, "bottom": 3.0, "left": 4.0}"#, + Padding::Custom { + top: 1.0, + right: 2.0, + bottom: 3.0, + left: 4.0, + }, + ), + ]; + for (json, expected) in tests { + let deserialized: Padding = serde_json::from_str(json).unwrap(); + assert_eq!(deserialized, expected); + } + } +} diff --git a/examples/common/mod.rs b/examples/common/mod.rs index 7ff8e206..a263feee 100644 --- a/examples/common/mod.rs +++ b/examples/common/mod.rs @@ -36,10 +36,30 @@ enum Svg { Yes(Option), } +#[cfg(feature = "serde")] +#[derive(Debug, Clone, Default)] +enum Json { + #[default] + No, + Yes(Option), +} + +#[cfg(feature = "serde")] +#[derive(Debug, Clone, Default)] +enum Yml { + #[default] + No, + Yes(Option), +} + #[derive(Debug, Clone, Default)] struct Args { png: Png, svg: Svg, + #[cfg(feature = "serde")] + json: Json, + #[cfg(feature = "serde")] + yml: Yml, show: bool, style: Option