Skip to content

Commit

Permalink
more hex_color fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Dec 6, 2022
1 parent b66d516 commit b7cceed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/ecolor/src/hex_color.rs
Expand Up @@ -20,17 +20,20 @@ macro_rules! hex_color {

#[test]
fn test_from_rgb_hex() {
assert_eq!(Color32::from_rgb(0x20, 0x21, 0x22), hex_color!("#202122"));
assert_eq!(
Color32::from_rgb_additive(0x20, 0x21, 0x22),
crate::Color32::from_rgb(0x20, 0x21, 0x22),
hex_color!("#202122")
);
assert_eq!(
crate::Color32::from_rgb_additive(0x20, 0x21, 0x22),
hex_color!("#202122").additive()
);
}

#[test]
fn test_from_rgba_hex() {
assert_eq!(
Color32::from_rgba_unmultiplied(0x20, 0x21, 0x22, 0x50),
crate::Color32::from_rgba_unmultiplied(0x20, 0x21, 0x22, 0x50),
hex_color!("20212250")
);
}

0 comments on commit b7cceed

Please sign in to comment.