How to make GTK icons dark/light theme-aware

For using symbolic icons, that change color, …

Further, if you want to manually detect colors of the theme, you can use this:

GdkRGBA foreground_color = {0};
GtkWidget * tmp = gtk_button_new ();
GtkStyleContext * context = gtk_widget_get_style_context (tmp);
gtk_style_context_get_color (context,GTK_STATE_FLAG_NORMAL,&foreground_color);
gtk_widget_destroy (tmp);