diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-01-09 23:18:43 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-01-10 14:50:13 -0500 |
commit | 1577db00927ae75d6ad273230241e301b5eb381d (patch) | |
tree | dfe0dfd9c3ce3fc9325b5b8f2ec02e472888811f | |
parent | ea7ab799ad234825e2321fc09a85b712c477d61e (diff) | |
download | gtk+-1577db00927ae75d6ad273230241e301b5eb381d.tar.gz |
Add opaque black singleton
-rw-r--r-- | gtk/gtkcssrgbavalue.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtkcssrgbavalue.c b/gtk/gtkcssrgbavalue.c index dad1f3ee39..a45709ad8f 100644 --- a/gtk/gtkcssrgbavalue.c +++ b/gtk/gtkcssrgbavalue.c @@ -110,6 +110,7 @@ static const GtkCssValueClass GTK_CSS_VALUE_RGBA = { static GtkCssValue transparent_black_singleton = { >K_CSS_VALUE_RGBA, 1, { 0, 0, 0, 0 }}; static GtkCssValue transparent_white_singleton = { >K_CSS_VALUE_RGBA, 1, { 1, 1, 1, 0 }}; +static GtkCssValue opaque_black_singleton = { >K_CSS_VALUE_RGBA, 1, { 0, 0, 0, 1 }}; static GtkCssValue opaque_white_singleton = { >K_CSS_VALUE_RGBA, 1, { 1, 1, 1, 1 }}; GtkCssValue * @@ -137,6 +138,11 @@ _gtk_css_rgba_value_new_from_rgba (const GdkRGBA *rgba) rgba->green == 1 && rgba->blue == 1) return _gtk_css_value_ref (&opaque_white_singleton); + + if (rgba->red == 0 && + rgba->green == 0 && + rgba->blue == 0) + return _gtk_css_value_ref (&opaque_black_singleton); } value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_RGBA); |