Skip to content

Commit e314bb3

Browse files
cyrganinot-fl3
authored andcommitted
make Color::from_hex const
1 parent 879ef13 commit e314bb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/color.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl Color {
125125
/// assert_eq!(light_blue.b, 0.8352941);
126126
/// assert_eq!(light_blue.a, 1.00);
127127
/// ```
128-
pub fn from_hex(hex: u32) -> Color {
128+
pub const fn from_hex(hex: u32) -> Color {
129129
let bytes: [u8; 4] = hex.to_be_bytes();
130130

131131
Self::from_rgba(bytes[1], bytes[2], bytes[3], 255)

0 commit comments

Comments
 (0)