1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

updated metro color algorithm

This commit is contained in:
Techywarrior 2013-04-04 13:36:25 -07:00
parent 92640214f4
commit 25e062004f

View file

@ -257,8 +257,12 @@
getMetroColor: function (str) { getMetroColor: function (str) {
if (str) { if (str) {
var char = str.substr(0, 1).charCodeAt(); var char = String(str.substr(0, 1).charCodeAt());
var index = String(char).substr(char.length, 1); var sum = 0;
for (var i = 0; i < char.length; i++) {
sum += parseInt(char.charAt(i));
}
var index = String(sum).substr(-1);
return LibraryBrowser.metroColors[index]; return LibraryBrowser.metroColors[index];
} else { } else {