Auto merge of #17092 - heycam:document-colors, r=xidorn

style: Add support for disabled document colors.

Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1355716.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17092)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-30 06:10:42 -05:00 committed by GitHub
commit 43862ba045
15 changed files with 103 additions and 13 deletions

View file

@ -177,6 +177,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);