*
* Gets the foreground color for a given state.
*
- * Deprecated: 4.10: This api will be removed in GTK 5
+ * Deprecated: 4.10: Use [method@Gtk.Widget.get_style_color] instead
*/
void
gtk_style_context_get_color (GtkStyleContext *context,
#include "gtkconstraint.h"
#include "gtkcssboxesprivate.h"
#include "gtkcssfiltervalueprivate.h"
+#include "gtkcsscolorvalueprivate.h"
#include "gtkcsstransformvalueprivate.h"
#include "gtkcsspositionvalueprivate.h"
#include "gtkcssfontvariationsvalueprivate.h"
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_CSS_CLASSES]);
}
+/**
+ * gtk_widget_get_css_style:
+ * @widget: a `GtkWidget`
+ * @color: (out): return location for the color
+ *
+ * Gets the current foreground color for the widgets
+ * CSS style.
+ *
+ * This function should only be used in snapshot
+ * implementations that need need to do custom
+ * drawing with the foreground color.
+ *
+ * Since: 4.10
+ */
+void
+gtk_widget_get_style_color (GtkWidget *widget,
+ GdkRGBA *color)
+{
+ GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
+ GtkCssStyle *style;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ style = gtk_css_node_get_style (priv->cssnode);
+ *color = *gtk_css_color_value_get_rgba (style->core->color);
+}
+
/*< private >
* gtk_widget_update_orientation:
* @widget: a `GtkWidget` implementing `GtkOrientable`