diff options
Diffstat (limited to 'src/style/colors.rs')
-rw-r--r-- | src/style/colors.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/style/colors.rs b/src/style/colors.rs index 4854da8..3b9ce07 100644 --- a/src/style/colors.rs +++ b/src/style/colors.rs @@ -22,36 +22,3 @@ predefined_color!(YELLOW, 255, 255, 0, "The predefined yellow color"); predefined_color!(CYAN, 0, 255, 255, "The predefined cyan color"); predefined_color!(MAGENTA, 255, 0, 255, "The predefined magenta color"); predefined_color!(TRANSPARENT, 0, 0, 0, 0.0, "The predefined transparent"); - -/// Predefined Color definitions using the [palette](https://docs.rs/palette/) color types -#[cfg(feature = "palette_ext")] -pub mod palette_ext { - use palette::rgb::Srgb; - use palette::Alpha; - - use std::marker::PhantomData; - - macro_rules! predefined_color_pal { - ($name:ident, $r:expr, $g:expr, $b:expr, $doc:expr) => { - #[doc = $doc] - pub const $name: Srgb<u8> = predefined_color_pal!(@gen_c $r, $g, $b); - }; - ($name:ident, $r:expr, $g:expr, $b:expr, $a:expr, $doc:expr) => { - #[doc = $doc] - pub const $name: Alpha<Srgb<u8>, f64> = Alpha{ alpha: $a, color: predefined_color_pal!(@gen_c $r, $g, $b) }; - }; - (@gen_c $r:expr, $g:expr, $b:expr) => { - Srgb { red: $r, green: $g, blue: $b, standard: PhantomData } - }; - } - - predefined_color_pal!(WHITE, 255, 255, 255, "The predefined white color"); - predefined_color_pal!(BLACK, 0, 0, 0, "The predefined black color"); - predefined_color_pal!(RED, 255, 0, 0, "The predefined red color"); - predefined_color_pal!(GREEN, 0, 255, 0, "The predefined green color"); - predefined_color_pal!(BLUE, 0, 0, 255, "The predefined blue color"); - predefined_color_pal!(YELLOW, 255, 255, 0, "The predefined yellow color"); - predefined_color_pal!(CYAN, 0, 255, 255, "The predefined cyan color"); - predefined_color_pal!(MAGENTA, 255, 0, 255, "The predefined magenta color"); - predefined_color_pal!(TRANSPARENT, 0, 0, 0, 0.0, "The predefined transparent"); -} |