style: Expose colors via cbindgen.

Also s/Foreground/CurrentColor.

Differential Revision: https://phabricator.services.mozilla.com/D25975
This commit is contained in:
Emilio Cobos Álvarez 2019-04-04 11:34:56 +00:00
parent a6f32bc762
commit 691eb36ffe
6 changed files with 50 additions and 37 deletions

View file

@ -33,8 +33,8 @@ impl Color {
// Common cases that the complex color is either pure numeric
// color or pure currentcolor.
GenericColor::Numeric(color) => return color,
GenericColor::Foreground => return fg_color,
GenericColor::Complex(color, ratios) => (color, ratios),
GenericColor::CurrentColor => return fg_color,
GenericColor::Complex { color, ratios } => (color, ratios),
};
// For the more complicated case that the alpha value differs,
@ -76,7 +76,7 @@ impl ToCss for Color {
{
match *self {
GenericColor::Numeric(color) => color.to_css(dest),
GenericColor::Foreground => CSSParserColor::CurrentColor.to_css(dest),
GenericColor::CurrentColor => CSSParserColor::CurrentColor.to_css(dest),
_ => Ok(()),
}
}