Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3205 closed defect (fixed)

[PATCH] Too dark colors for playernames in multiplayer lobby and gamesetup_chat

Reported by: fpre_O_O_O_O_O_O Owned by: elexis
Priority: Should Have Milestone: Alpha 20
Component: Multiplayer lobby Keywords: patch
Cc: Patch:

Description (last modified by elexis)

Some players with short names get dark blue as the color for their nickname. Since the names are short and the color is very dark on dark background, you have a hard time reading that playername without zooming in / going closer to the screen.

This can be fixed easily by increasing the minimum brightness of the player color chosen.

This patch enlightens too dark colors by increasing the minimum lightness: attachment:t3205_enlighten_too_dark_chat_colors.patch:ticket:3205

Here a comparison (left without patch, right with patch): A comparison between the playerlist without (left) and with the patch (right). Notice how you can't read the name PA without zooming in. It seems all players with 3 letters are affected of the blue that is too dark. Also notice that most of the player colors are untouched while only those that are really too dark are fixed.

Attachments (16)

lobby_color_fix.patch (611 bytes ) - added by fpre_O_O_O_O_O_O 9 years ago.
quick fix for dark colors
lobby_color_fix_svn.patch (1.1 KB ) - added by elexis 9 years ago.
Same patch but for svn version.
screenshot0002.png (1.3 MB ) - added by fpre_O_O_O_O_O_O 9 years ago.
lookslike
before.png (1.1 MB ) - added by fpre_O_O_O_O_O_O 9 years ago.
before
gamesetup_player_colors_in_chat.png (597.5 KB ) - added by fpre_O_O_O_O_O_O 9 years ago.
new colors for chat (enlighted)
new_common_color_file.patch (1.5 KB ) - added by fpre_O_O_O_O_O_O 9 years ago.
new file for merging hsl to rgb function necessary for lobby and gamesetup colors into one file spreading them over to both
gamesetup_xml_colors_fix.patch (376 bytes ) - added by fpre_O_O_O_O_O_O 9 years ago.
new xml file due to using color.js from gui/common/ now
lobby_xml_colors_fix.patch (398 bytes ) - added by fpre_O_O_O_O_O_O 9 years ago.
new xml file due to using color.js from gui/common/ now
lobby_colors_fix.patch (1.5 KB ) - added by fpre_O_O_O_O_O_O 9 years ago.
quick fix for dark colors
gamesetup_colors_fix.patch (681 bytes ) - added by fpre_O_O_O_O_O_O 9 years ago.
fix player colors in gamesetup for better reading
lobby_gamesetup_color_complete.patch (6.4 KB ) - added by fpre_O_O_O_O_O_O 9 years ago.
One File Patch
t3205_enlighten_too_dark_chat_colors.patch (7.8 KB ) - added by elexis 9 years ago.
Thanks for uploading a patch with all changes in a single file. Unfortunately this patch can't be applied, since the directory names are different. This patch works for SVN. The only thing I still would change is the red color in the gamesetup chat, it looks too bright in my opinion. Not sure how to fix this without making blue unreadable again and not changing each color individually (maybe thats just the easiest way then?).
comparison.png (271.9 KB ) - added by elexis 9 years ago.
A comparison between the playerlist without (left) and with the patch (right). Notice how you can't read the name PA without zooming in. It seems all players with 3 letters are affected of the blue that is too dark. Also notice that most of the player colors are untouched while only those that are really too dark are fixed.
t3205_enlighten_too_dark_chat_colors_a18.patch (7.6 KB ) - added by elexis 9 years ago.
Same patch as above, but compatible to a18.
t3205_enlighten_too_dark_chat_colors_v2.patch (16.0 KB ) - added by elexis 9 years ago.
Created the ensureMinimumLightness function. Moved player color values and functions to color.js, so that it can be used in other pages too. Moved the hardcoded color values used only in the lobby to the beginning of lobby.js Removed most of fixedColors since they were not used anywhere (which also allowed the removal of the hexToRgb and r function).
t3205_enlighten_too_dark_chat_colors_v2.1.patch (16.0 KB ) - added by elexis 9 years ago.
ensureMinimumLightness was incorrectly applied in gamesetup.js.

Change History (28)

by fpre_O_O_O_O_O_O, 9 years ago

Attachment: lobby_color_fix.patch added

quick fix for dark colors

comment:1 by elexis, 9 years ago

Description: modified (diff)
Keywords: patch review added
Summary: to dark colors in playernames in multiplayer lobby like dark blue as unreadable[PATCH] Too dark colors for playernames in multiplayer lobby

by elexis, 9 years ago

Attachment: lobby_color_fix_svn.patch added

Same patch but for svn version.

by fpre_O_O_O_O_O_O, 9 years ago

Attachment: screenshot0002.png added

lookslike

by fpre_O_O_O_O_O_O, 9 years ago

Attachment: before.png added

before

comment:2 by fpre_O_O_O_O_O_O, 9 years ago

Description: modified (diff)

by fpre_O_O_O_O_O_O, 9 years ago

new colors for chat (enlighted)

comment:3 by fpre_O_O_O_O_O_O, 9 years ago

Summary: [PATCH] Too dark colors for playernames in multiplayer lobby[PATCH] Too dark colors for playernames in multiplayer lobby and gamesetup_chat

by fpre_O_O_O_O_O_O, 9 years ago

Attachment: new_common_color_file.patch added

new file for merging hsl to rgb function necessary for lobby and gamesetup colors into one file spreading them over to both

by fpre_O_O_O_O_O_O, 9 years ago

new xml file due to using color.js from gui/common/ now

by fpre_O_O_O_O_O_O, 9 years ago

Attachment: lobby_xml_colors_fix.patch added

new xml file due to using color.js from gui/common/ now

by fpre_O_O_O_O_O_O, 9 years ago

Attachment: lobby_colors_fix.patch added

quick fix for dark colors

by fpre_O_O_O_O_O_O, 9 years ago

Attachment: gamesetup_colors_fix.patch added

fix player colors in gamesetup for better reading

by fpre_O_O_O_O_O_O, 9 years ago

One File Patch

by elexis, 9 years ago

Thanks for uploading a patch with all changes in a single file. Unfortunately this patch can't be applied, since the directory names are different. This patch works for SVN. The only thing I still would change is the red color in the gamesetup chat, it looks too bright in my opinion. Not sure how to fix this without making blue unreadable again and not changing each color individually (maybe thats just the easiest way then?).

comment:4 by elexis, 9 years ago

Also the code in gamesetup.js was simiplified.

by elexis, 9 years ago

Attachment: comparison.png added

A comparison between the playerlist without (left) and with the patch (right). Notice how you can't read the name PA without zooming in. It seems all players with 3 letters are affected of the blue that is too dark. Also notice that most of the player colors are untouched while only those that are really too dark are fixed.

comment:5 by elexis, 9 years ago

Description: modified (diff)

comment:6 by elexis, 9 years ago

The patch above changes the dark blue color of player 1 in the gamesetup chat too. However in the diplomacy menu that color is too dark too (The playername in the list and in the tooltip when tributing resources).

by elexis, 9 years ago

Same patch as above, but compatible to a18.

comment:7 by Itms, 9 years ago

Keywords: review removed

Some comments:

  • Don't remove the link to StackOverflow
  • Don't forget to remove the clamping function that is copied to the new file
  • We should move the hardcoded color values in the code to some easily accessible variable (putting it in the new file is probably nice).
  • The RGB->HSV->RGB trick to enlighten the color should be either commented, either moved to a separate function with a meaningful name (I'd prefer the latter).

The most important comment: A18 doesn't exist anymore. More seriously, we don't try to be retrocompatible and we don't release fixes for older versions (unless they are unusable on some architectures), so every fix should be designed for the development version.

by elexis, 9 years ago

Created the ensureMinimumLightness function. Moved player color values and functions to color.js, so that it can be used in other pages too. Moved the hardcoded color values used only in the lobby to the beginning of lobby.js Removed most of fixedColors since they were not used anywhere (which also allowed the removal of the hexToRgb and r function).

by elexis, 9 years ago

ensureMinimumLightness was incorrectly applied in gamesetup.js.

comment:8 by Stan, 9 years ago

Milestone: Alpha 19Alpha 20

Pushing by elexis saddened request :P

comment:9 by elexis, 8 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 17362:

Enlighten too dark username-colors in the lobby and gamesetup-chat. Patch by fpre, fixes #3205.

comment:10 by elexis, 8 years ago

Rebased fpre's original patch in attachment:lobby_gamesetup_color_complete.patch and added JSdoc comments instead of regular ones. Also fixed coding style and reduced the minimum lightness of the gamesetup chat from 0.7 to 0.6.

Further refactoring and "balancing" of hardcoded color values will be done in future commits.

Thanks for the patch!

comment:11 by historic_bruno, 8 years ago

Nice work, I always found the dark blue names particularly annoying and difficult to read on my monitor :P

comment:12 by elexis, 8 years ago

In 17850:

Add svott (refs #3736) and fpre (refs #3205) to the contributors.

Note: See TracTickets for help on using tickets.