Method

GtkStyleContextget_background_color

Declaration [src]

void
gtk_style_context_get_background_color (
  GtkStyleContext* context,
  GtkStateFlags state,
  GdkRGBA* color
)

Description [src]

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 gtk_style_context_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 gtk_render_background() instead, along with CSS style classes to modify the color to be rendered.

Available since:3.0
Deprecated since:3.16

Use gtk_render_background() instead.

Parameters

state GtkStateFlags
 

State to retrieve the color for.

color GdkRGBA
 

Return value for the background color.

 The argument will be set by the function.
 The data is owned by the caller of the function.