Themes can be flagged as 'dark', which makes nick highlighting a bit more legible
authorNick Fisher <spadgos@gmail.com>
Mon, 5 Jan 2015 17:44:30 +0000 (18:44 +0100)
committerNick Fisher <spadgos@gmail.com>
Mon, 5 Jan 2015 17:44:30 +0000 (18:44 +0100)
client/assets/themes/cli/theme.json
client/src/views/channel.js

index e70afca8a1ee3fdbb20b6de46eaa3ee85a218fc2..a05c6829e08f90a91214691aba41b1ddeaa470d7 100644 (file)
@@ -1,4 +1,5 @@
 {
        "name": "CLI",
-       "thumbnail_colour": "#222"
-}
\ No newline at end of file
+       "thumbnail_colour": "#222",
+       "dark": true
+}
index 4275358928c46100f98a5ba25dc8d9ce5952b81d..6d521d398017a81bbc492b7653034757af75a09b 100644 (file)
@@ -244,11 +244,16 @@ _kiwi.view.Channel = _kiwi.view.Panel.extend({
 
     // Sgnerate a css style for a nick
     getNickStyles: function(nick) {
-        var ret, colour, nick_int = 0, rgb;
+        var ret, colour, nick_int = 0, rgb, isDark;
 
         // Get a colour from a nick (Method based on IRSSIs nickcolor.pl)
         _.map(nick.split(''), function (i) { nick_int += i.charCodeAt(0); });
-        rgb = hsl2rgb(nick_int % 255, 70, 35);
+
+        isDark = (_.find(_kiwi.app.themes, function (theme) {
+            return theme.name.toLowerCase() === _kiwi.global.settings.get('theme').toLowerCase();
+        }) || {}).dark;
+
+        rgb = hsl2rgb(nick_int % 255, 70, isDark ? 60 : 35);
         rgb = rgb[2] | (rgb[1] << 8) | (rgb[0] << 16);
         colour = '#' + rgb.toString(16);