mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Add support for disabled document colors.
This commit is contained in:
parent
9e89b0a229
commit
c768169149
15 changed files with 103 additions and 13 deletions
|
@ -178,6 +178,15 @@ impl CSSColor {
|
|||
authored: None,
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns false if the color is completely transparent, and
|
||||
/// true otherwise.
|
||||
pub fn is_non_transparent(&self) -> bool {
|
||||
match self.parsed {
|
||||
Color::RGBA(rgba) if rgba.alpha == 0 => false,
|
||||
_ => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
no_viewport_percentage!(CSSColor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue