aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/util.vala
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/util.vala')
-rw-r--r--main/src/ui/util.vala5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/src/ui/util.vala b/main/src/ui/util.vala
index 9ed28b1f..2cf070b0 100644
--- a/main/src/ui/util.vala
+++ b/main/src/ui/util.vala
@@ -105,6 +105,11 @@ public class Util : Object {
public static void force_error_color(Gtk.Widget widget, string selector = "*") {
force_color(widget, "@error_color", selector);
}
+
+ public static bool is_dark_theme(Gtk.Widget widget) {
+ Gdk.RGBA bg = widget.get_style_context().get_background_color(StateFlags.NORMAL);
+ return (bg.red < 0.5 && bg.green < 0.5 && bg.blue < 0.5);
+ }
}
} \ No newline at end of file