Macro cosmic::iced_style::core::color
source · macro_rules! color { ($r:expr, $g:expr, $b:expr) => { ... }; ($r:expr, $g:expr, $b:expr, $a:expr) => { ... }; ($hex:expr) => { ... }; ($hex:expr, $a:expr) => { ... }; }
Expand description
Creates a Color
with shorter and cleaner syntax.
§Examples
assert_eq!(color!(0, 0, 0), Color::from_rgb(0., 0., 0.));
assert_eq!(color!(0, 0, 0, 0.), Color::from_rgba(0., 0., 0., 0.));
assert_eq!(color!(0xffffff), Color::from_rgb(1., 1., 1.));
assert_eq!(color!(0xffffff, 0.), Color::from_rgba(1., 1., 1., 0.));