-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS classes in themes for nick colors #325
Conversation
|
||
return "color-" + hash % 64; | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can definitely be improved with all sorts of crazy hashing. However, considering the end goal, I don't think having a not-perfectly-random solution is not a big deal.
Also, I didn't cache classes as we currently do. I don't think this is going to affect performance though. A fast hashing function (fast over randomness quality) is probably the way to go anyway.
Suggestions welcome :-)
e482166
to
7f551f1
Compare
This looks pretty good to me. The only issue is that the dark theme colours are quite similar (it looks like we have maybe 6 or 7 distinct colours). However, I think getting this PR in first and improving the colours over time would be a good plan, because currently it's very hard to see nearly half of the usernames on the dark themes. |
@@ -752,6 +752,71 @@ button, | |||
color: #50a656 !important; | |||
} | |||
|
|||
#chat .user.color-1 { color: #1396cf; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your indexes are off. Either you need to add 1
in colorClass
function or re-index classes to be 0-63.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops my bad, good catch. Fixed in the colorClass
function.
7f551f1
to
a56e2f5
Compare
a56e2f5
to
826903e
Compare
I think 32 is probably fine. The colours look much better and less similar, and very rarely are you going to have 32 people chatting for it to be a problem. My vote for 32. |
32 is OK. I looked at HexChat, and they have mere 9. @astorije Change |
c2f63c5
to
62a8417
Compare
These colors were built using the current generation function to have similar style.
These colors have been generated by the randomColor package
This will reset users' preference regarding colored nicknames but it's to make it more specific than just "colors".
62a8417
to
1af00d3
Compare
Alright, I'm all set @xPaw! Let's ship it, I have further unrelated improvements to make but I don't want to do that before it gets merged :-) |
@@ -437,7 +437,7 @@ $(function() { | |||
var settings = $("#settings"); | |||
var options = $.extend({ | |||
desktopNotifications: false, | |||
colors: false, | |||
coloredNicks: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't rename the option, as you break previously stored setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for the record:
16:07 +xPaw astorije, looks OK except for the renamed settings, i'll test it today or tomorrow
16:08 +astorije xPaw, what's wrong with the renamed settings§?
16:08 +xPaw backwards compat
16:08 +xPaw I would rather leave renaming settings to Max-P's PR
16:08 +astorije I know it breaks settings, but if we are jumping 2.0.0 I'm not too complexed about it
16:09 +astorije To be honest, I am not too happy having a class that is system specific like that simply called "colors"
16:09 +astorije And leaving the renaming to Max-P's PR means changing 32 * 4 lines
16:09 +xPaw i specifically mean the setting name
16:09 +xPaw class can stay
16:09 +astorije Oh right, my bad
16:09 +astorije Yeah
16:10 +astorije I'd say the earlier the better, especially if we jump 2.x
16:10 +astorije If we end up not doing it (which I doubt more and more), then fine, but otherwise...
16:10 +xPaw eh, fuck it, fine
16:10 +xPaw i'll test it later to make sure nothing broke
16:10 +astorije lol
16:10 +astorije Sure
16:10 +astorije I tested the 4 themes in private browsing fyi
👍 Looks all fine to me. The only unrelated thing I noticed is that we use That would do two things:
|
Can't do that, it breaks highlighting on firefox. I thought we changed the userlist to use links, but apparently not. |
Hm, what about |
I'll have to test that later. I don't run firefox at work anymore (used to, that's how I found the bugs). Will check sometime. |
What about the original PR, @YaManicKill? |
This PR? Yeah, I'm happy with it. 👍 I'll merge as this is second review. Good job, @astorije I'm really looking forward to having this in release. |
CSS classes in themes for nick colors
Advantages compared to the current system:
Main drawback of course is new themes have to ship between a few colors up to 64 (but that's the whole point 😄). A quick HTML tool to generate classes will be very easy to do in a few lines of code using
randomColor
package or whatever solution so that theme authors can bootstrap this in no time.About the colors themselves:
crypto
as well) have been generated based on the existing code. It's difficult to tell the difference between master and this PR. However, we have the same issues than current system, meaning some are too bright, etc.randomColor
package featured in Generate better nick colors #322randomColor
package), I noted a lot of "visual semi-duplicates". My guess is 32 should be enough, but it doesn't really matter.Screenshots:
In situ: