Gtk.Widget.prototype.override_color
function override_color(state:Gtk.StateFlags, color:Gdk.RGBA):void { // Gjs wrapper for gtk_widget_override_color() }
Sets the color to use for a widget.
All other style values are left untouched.
<note><para> This API is mostly meant as a quick way for applications to change a widget appearance. If you are developing a widgets library and intend this change to be themeable, it is better done by setting meaningful CSS classes and regions in your widget/container implementation through Gtk.StyleContext.prototype.add_class and Gtk.StyleContext.prototype.add_region. </para><para> This way, your widget library can install a Gtk.CssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order to provide a default styling for those widgets that need so, and this theming may fully overridden by the user's theme. </para></note> <note><para> Note that for complex widgets this may bring in undesired results (such as uniform background color everywhere), in these cases it is better to fully style such widgets through a Gtk.CssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION priority. </para></note>
Since 3.0
- state
the state for which to set the color
- color
the color to assign, or null to undo the effect of previous calls to Gtk.Widget.prototype.override_color