Ticket #3205: lobby_color_fix_svn.patch

File lobby_color_fix_svn.patch, 1.1 KB (added by elexis, 9 years ago)

Same patch but for svn version.

  • binaries/data/mods/public/gui/lobby/lobby.js

     
    10361036    // First create the color in RGB then HSL, clamp the lightness so it's not too dark to read, and then convert back to RGB to display.
    10371037    // The reason for this roundabout method is this algorithm can generate values from 0 to 255 for RGB but only 0 to 100 for HSL; this gives
    10381038    // us much more variety if we generate in RGB. Unfortunately, enforcing that RGB values are a certain lightness is very difficult, so
    10391039    // we convert to HSL to do the computation. Since our GUI code only displays RGB colors, we have to convert back.
    10401040    var [h, s, l] = rgbToHsl(hash >> 24 & 0xFF, hash >> 16 & 0xFF, hash >> 8 & 0xFF);
    1041     return hslToRgb(h, s, Math.max(0.4, l)).join(" ");
     1041    return hslToRgb(h, s, Math.max(0.7, l)).join(" ");
    10421042}
    10431043
    10441044function repeatString(times, string) {
    10451045    return Array(times + 1).join(string);
    10461046}