fix(theme): include alpha value in to_hex
This commit is contained in:
parent
b8266b6100
commit
e302e9505c
1 changed files with 4 additions and 1 deletions
|
|
@ -42,5 +42,8 @@ impl Theme {
|
||||||
|
|
||||||
pub fn to_hex(c: Srgba) -> String {
|
pub fn to_hex(c: Srgba) -> String {
|
||||||
let c_u8: Rgba<palette::encoding::Srgb, u8> = c.into_format();
|
let c_u8: Rgba<palette::encoding::Srgb, u8> = c.into_format();
|
||||||
format!("{:02x}{:02x}{:02x}", c_u8.red, c_u8.green, c_u8.blue)
|
format!(
|
||||||
|
"{:02x}{:02x}{:02x}{:02x}",
|
||||||
|
c_u8.red, c_u8.green, c_u8.blue, c_u8.alpha
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue