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:
parent
92640214f4
commit
25e062004f
1 changed files with 6 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue