Skip to content

Commit

Permalink
Improve name color readability
Browse files Browse the repository at this point in the history
This narrows the range of possible lightness for generated name
colors.
  • Loading branch information
Zarel committed Jun 8, 2015
1 parent 0d9d56a commit 5c40d42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/battledata.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function hashColor(name) {
}
var H = parseInt(hash.substr(4, 4), 16) % 360;
var S = parseInt(hash.substr(0, 4), 16) % 50 + 50;
var L = parseInt(hash.substr(8, 4), 16) % 20 + 25;
var L = Math.floor(parseInt(hash.substr(8, 4), 16) % 20 / 2 + 30);
colorCache[name] = "color:hsl(" + H + "," + S + "%," + L + "%);";
return colorCache[name];
}
Expand Down

0 comments on commit 5c40d42

Please sign in to comment.