Package: gtk

Function gtk:style-context-background-color

Lambda List

gtk:style-context-background-color (context state)

Arguments

context -- a gtk:style-context object
state -- a value of the gtk:state-flags flags to retrieve the color for

Return Value

Returns the gdk:rgba background color.

Details

Gets the background color for a given state. This function is far less useful than it seems, and it should not be used in newly written code. CSS has no concept of "background color", as a background can be an image, or a gradient, or any other pattern including solid colors. The only reason why you would call the gtk:style-context-background-color function is to use the returned value to draw the background with it. The correct way to achieve this result is to use the gtk:render-background function instead, along with CSS style classes to modify the color to be rendered.

Warning

The gtk:style-context-background-color function has been deprecated since version 3.16 and should not be used in newly written code. Use the gtk:render-background function instead.
 

See also

#2023-3-27