fix(theme): gtk3 css doesn't allow hex colors with alpha
This commit is contained in:
parent
428dafe37c
commit
8b0bb6a677
2 changed files with 79 additions and 71 deletions
|
|
@ -47,3 +47,11 @@ pub fn to_hex(c: Srgba) -> String {
|
|||
c_u8.red, c_u8.green, c_u8.blue, c_u8.alpha
|
||||
)
|
||||
}
|
||||
|
||||
pub fn to_rgba(c: Srgba) -> String {
|
||||
let c_u8: Rgba<palette::encoding::Srgb, u8> = c.into_format();
|
||||
format!(
|
||||
"rgba({}, {}, {}, {:1.2})",
|
||||
c_u8.red, c_u8.green, c_u8.blue, c.alpha
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue