Username colors should be lightened up for dark theme :rejected:

Contributor
Joined
Jan 19, 2018
Messages
648
Browsing the forums usernames and colored text seems too dark to me on the dark theme.
As a test I tried playing with some code to automatically lighten up text colors and I think it's a good improvement.
I'm not quite sure if you'd want to use this code for all colored text in dark mode but that might be worth considering.

Code:
$('[style^=color]').each(function(){
			var color = $(this).css('color').split('(')[1].split(')')[0].split(', ');
			var r = Number(color[0]), g = Number(color[1]), b = Number(color[2]);
			var ave = 0.2126*r + 0.7152*g + 0.0722*b;
			if (ave == 0) {
				$(this).css({'color': '#FFFFFF'});
				return;
			}
			var ratio = 150 / ave;
			r = Math.round(Math.max(Math.min(ratio*r, 255), 0));
			g = Math.round(Math.max(Math.min(ratio*g, 255), 0));
			b = Math.round(Math.max(Math.min(ratio*b, 255), 0));
			$(this).css({'color': 'rgb('+r+', '+g+', '+b+')'});
		});

And here's the difference it makes:
uzvWxvM.gif
 
Miku best girl
Admin
Joined
May 29, 2012
Messages
1,441
The colours for the user roles are the same for light and dark mode, so I have to find a shade which works in both light and dark theme.
 
Contributor
Joined
Jan 19, 2018
Messages
648
Yeah I know how hard that can be.
They don't have to be the same and I present a possible way to automatically lighten them (and other colored text) for the dark theme.
 
Joined
Jan 19, 2018
Messages
14
I am personally a fan of the monokai colour scheme. It's quite vibrant. I use this variant in VS Code: https://www.monokai.pro/

A side note, it would be handy to have a legend somewhere (perhaps as an alt tag on the username?) to show what the colour represents.
 
Instrumentality Instigator
Staff
Super Moderator
Joined
Jan 29, 2018
Messages
1,343
I'm not really sure what to tag this. Holo has said that color customization will be possible (at least for the forums) and it's already possible to use Stylish to change the look of MD in order to make your username colors a little more bearable.

Believe it or not, it's harder than it looks to find a color that works on both light and dark themes.

I think I'll move it to rejected for now. When we get customization options in the future, we can revisit the conversation.
 

Users who are viewing this thread

Top