From 2804799f61eb4c68c5cf88b9996d13a81fe6317d Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 13 Mar 2017 15:34:17 +0100 Subject: Reduce GTK dependency to 3.16, fix dark theme --- main/src/ui/util.vala | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'main/src/ui/util.vala') diff --git a/main/src/ui/util.vala b/main/src/ui/util.vala index 0a294731..aad0817d 100644 --- a/main/src/ui/util.vala +++ b/main/src/ui/util.vala @@ -9,17 +9,21 @@ public class Util : Object { private const string[] tango_colors_light = {"FCE94F", "FCAF3E", "E9B96E", "8AE234", "729FCF", "AD7FA8", "EF2929"}; private const string[] tango_colors_medium = {"EDD400", "F57900", "C17D11", "73D216", "3465A4", "75507B", "CC0000"}; - private const string[] material_colors_500 = {"F44336", "E91E63", "9C27B0", "673AB7", "3f51B5", "2196F3", "03A9f4", "00BCD4", "009688", "4CAF50", "8BC34a", "CDDC39", "FFEB3B", "FFC107", "FF9800", "FF5722", "795548"}; - private const string[] material_colors_300 = {"E57373", "F06292", "BA68C8", "9575CD", "7986CB", "64B5F6", "4FC3F7", "4DD0E1", "4DB6AC", "81C784", "AED581", "DCE775", "FFF176", "FFD54F", "FFB74D", "FF8A65", "A1887F"}; - private const string[] material_colors_200 = {"EF9A9A", "F48FB1", "CE93D8", "B39DDB", "9FA8DA", "90CAF9", "81D4FA", "80DEEA", "80CBC4", "A5D6A7", "C5E1A5", "E6EE9C", "FFF59D", "FFE082", "FFCC80", "FFAB91", "BCAAA4"}; + private const string[] material_colors_500 = {"F44336", "E91E63", "9C27B0", "673AB7", "3f51B5", "2196F3", "03A9f4", "00BCD4", "009688", "4CAF50", "8BC34a", "CDDC39", "FFC107", "FF9800", "FF5722", "795548"}; + private const string[] material_colors_300 = {"E57373", "F06292", "BA68C8", "9575CD", "7986CB", "64B5F6", "4FC3F7", "4DD0E1", "4DB6AC", "81C784", "AED581", "DCE775", "FFD54F", "FFB74D", "FF8A65", "A1887F"}; + private const string[] material_colors_200 = {"EF9A9A", "F48FB1", "CE93D8", "B39DDB", "9FA8DA", "90CAF9", "81D4FA", "80DEEA", "80CBC4", "A5D6A7", "C5E1A5", "E6EE9C", "FFE082", "FFCC80", "FFAB91", "BCAAA4"}; public static string get_avatar_hex_color(string name) { return material_colors_300[name.hash() % material_colors_300.length]; // return tango_colors_light[name.hash() % tango_colors_light.length]; } - public static string get_name_hex_color(string name) { - return material_colors_500[name.hash() % material_colors_500.length]; + public static string get_name_hex_color(string name, bool dark_theme = false) { + if (dark_theme) { + return material_colors_300[name.hash() % material_colors_300.length]; + } else { + return material_colors_500[name.hash() % material_colors_500.length]; + } // return tango_colors_medium[name.hash() % tango_colors_medium.length]; } -- cgit v1.2.3-70-g09d2