[pygtk] [GTK3] get background color

Osmo Salomaa otsaloma at iki.fi
Thu Aug 1 08:00:11 WST 2013


> Here is a very simple scrpit that shows the problem. For me it prints:
> <Gdk.Color(red=0.000000, green=0.000000, blue=0.000000, alpha=0.000000)>

For editable text fields, you're probably looking for the *base* color.

    style.lookup_color("theme_base_color")

For Adwaita, you can find the available color names in gtk-main.css [1],
but I really don't know if they work across different themes.

[1]
https://git.gnome.org/browse/gnome-themes-standard/tree/themes/Adwaita/gtk-3.0/gtk-main.css

-- 
Osmo Salomaa <otsaloma at iki.fi>


More information about the pygtk mailing list