Open crazy2k opened 9 years ago
Any comments?
I use an algorhitm in one of my projects, as of:
You must know the background's type, of course.
Hello! Sorry for the late reply.
Anyway. Maybe it's a better idea to use colors set by the theme, as you suggest. Instead of just randomly selecting a funky color, it could use:
.color-1 {}
.color-2 {}
.color-3 {}
// etc...
I'll see what I'll do about it. I'll ping this thread if there's any news.
Current template sets the nickname color using Handlebars'
stringcolor
helper. This helper uses thestringcolor()
function inclient/js/libs/stringcolor.js
which ends up callingstring_to_color()
. There's ashade()
function defined in there that allows for darkness/lightness to be altered. However, the value for that is fixed/hardcoded to -10.It's easy to manually change that number to something more suitable to the theme we're currently using. In my case, since I'm using
zenburn.css
, I can change that -10 to something higher so that nicknames look brighter. However, it'd be better to have this value a) adjusted automatically so that it plays well with the current background, or b) set by the theme itself (which now is just a CSS file, so probably this would require changes in the theming mechanism).How do you think would be the best way to implement this?