Skip to content

Instantly share code, notes, and snippets.

@kevans91
Created November 16, 2014 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevans91/2c7182605b982c4fbd18 to your computer and use it in GitHub Desktop.
Save kevans91/2c7182605b982c4fbd18 to your computer and use it in GitHub Desktop.
// Add some colours to the nick (Method based on IRSSIs nickcolor.pl)
nick_colour_hex = (function (nick) {
var nick_int = 0, rgb;
_.map(nick.split(''), function (i) { nick_int += i.charCodeAt(0); });
rgb = hsl2rgb(nick_int % 255, 70, 35);
rgb = rgb[2] | (rgb[1] << 8) | (rgb[0] << 16);
return '#' + rgb.toString(16);
})(msg.nick);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment