diff --git a/gtk/gtkcsscolorvalue.c b/gtk/gtkcsscolorvalue.c index a63f3ec277..ef3bf02e65 100644 --- a/gtk/gtkcsscolorvalue.c +++ b/gtk/gtkcsscolorvalue.c @@ -608,7 +608,7 @@ gtk_css_color_value_new_literal (const GdkRGBA *color) return value; } -static GtkCssValue * +GtkCssValue * gtk_css_color_value_new_color (GtkCssColorSpace color_space, gboolean serialize_as_rgb, float values[4], @@ -1633,3 +1633,12 @@ gtk_css_color_value_get_rgba (const GtkCssValue *color) return &color->rgba; } + +const GtkCssColor * +gtk_css_color_value_get_color (const GtkCssValue *color) +{ + g_assert (color->class == >K_CSS_VALUE_COLOR); + g_assert (color->type == COLOR_TYPE_COLOR); + + return &color->color; +} diff --git a/gtk/gtkcsscolorvalueprivate.h b/gtk/gtkcsscolorvalueprivate.h index 83681a4a3b..83d2833ac4 100644 --- a/gtk/gtkcsscolorvalueprivate.h +++ b/gtk/gtkcsscolorvalueprivate.h @@ -21,6 +21,7 @@ #include "gtk/css/gtkcsstokenizerprivate.h" #include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" +#include "gtkcsscolorprivate.h" G_BEGIN_DECLS @@ -37,6 +38,14 @@ GtkCssValue * gtk_css_color_value_resolve (GtkCssValue *color GtkCssValue *current); const GdkRGBA * gtk_css_color_value_get_rgba (const GtkCssValue *color) G_GNUC_CONST; +GtkCssValue * gtk_css_color_value_new_color (GtkCssColorSpace color_space, + gboolean serialize_as_rgb, + float values[4], + gboolean missing[4]) G_GNUC_PURE; + +const GtkCssColor * + gtk_css_color_value_get_color (const GtkCssValue *color) G_GNUC_CONST; + G_END_DECLS