get_background_color


Description:

[ Version ( deprecated = true , deprecated_since = "3.16" , since = "3.0" ) ]
public RGBA get_background_color (StateFlags state)

Warning: get_background_color is deprecated since 3.16.

Gets the background color for a given state.

Note:

Use render_background instead.

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 get_background_color is to use the returned value to draw the background with it; the correct way to achieve this result is to use render_background instead, along with CSS style classes to modify the color to be rendered.

Parameters:

this

a StyleContext

state

state to retrieve the color for

color

return value for the background color