How to get the background color of a widget in GTK and Python?
问题 I want to get the normal background color of a widget (a GtkHeaderBar , in this case). I'm currently using style = self.get_titlebar().get_style_context() to get the style, and color = style.get_property("background-color", Gtk.StateFlags.NORMAL) to get the background color associated to that style. However it returns a Gkd.RGBA object with the following properties: Gdk.RGBA(red=0.000000, green=0.000000, blue=0.000000, alpha=0.000000) But if I open GTK Inspector, select the HeaderBar, and