diff options
author | 2022-12-06 04:34:42 +0100 | |
---|---|---|
committer | 2022-12-06 04:34:42 +0100 | |
commit | c0ca1807d42b0ec58887df9926ff53a587104723 (patch) | |
tree | 61df12ecf614a6d44c7837b48e15a189c833ee81 /core | |
parent | b205a663471a8170d7b30cc59894425c09bea563 (diff) | |
download | iced-c0ca1807d42b0ec58887df9926ff53a587104723.tar.gz iced-c0ca1807d42b0ec58887df9926ff53a587104723.tar.bz2 iced-c0ca1807d42b0ec58887df9926ff53a587104723.zip |
Fix macro hygiene of `color!`
Diffstat (limited to '')
-rw-r--r-- | core/src/color.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/src/color.rs b/core/src/color.rs index e578eda4..2a4d43f4 100644 --- a/core/src/color.rs +++ b/core/src/color.rs @@ -161,24 +161,26 @@ impl From<[f32; 4]> for Color { #[macro_export] macro_rules! color { ($r:expr, $g:expr, $b:expr) => { - Color::from_rgb8($r, $g, $b) + $crate::Color::from_rgb8($r, $g, $b) }; ($r:expr, $g:expr, $b:expr, $a:expr) => { - Color::from_rgba8($r, $g, $b, $a) + $crate::Color::from_rgba8($r, $g, $b, $a) }; ($hex:expr) => {{ let hex = $hex as u32; let r = (hex & 0xff0000) >> 16; let g = (hex & 0xff00) >> 8; let b = (hex & 0xff); - Color::from_rgb8(r as u8, g as u8, b as u8) + + $crate::Color::from_rgb8(r as u8, g as u8, b as u8) }}; ($hex:expr, $a:expr) => {{ let hex = $hex as u32; let r = (hex & 0xff0000) >> 16; let g = (hex & 0xff00) >> 8; let b = (hex & 0xff); - Color::from_rgba8(r as u8, g as u8, b as u8, $a) + + $crate::Color::from_rgba8(r as u8, g as u8, b as u8, $a) }}; } |