diff options
Diffstat (limited to 'main/src/ui/util.vala')
-rw-r--r-- | main/src/ui/util.vala | 14 |
1 files changed, 9 insertions, 5 deletions
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]; } |