diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js
index 27b88d258..f882b7308 100644
--- a/dashboard-ui/scripts/Itemdetailpage.js
+++ b/dashboard-ui/scripts/Itemdetailpage.js
@@ -151,7 +151,7 @@
if (url) {
- var style = useBackgroundColor ? "background-color:" + Dashboard.getRandomMetroColor() + ";" : "";
+ var style = useBackgroundColor ? "background-color:" + Dashboard.getMetroColor(item.Id) + ";" : "";
html += "";
}
@@ -700,7 +700,9 @@
html += '
';
} else {
- html += '
';
+ var style = "background-color:" + Dashboard.getMetroColor(cast.Name) + ";";
+
+ html += '
';
}
html += '
";
+ html += "
";
}
else {
- html += "
";
+ html += "
";
}
if (showText) {
@@ -1146,6 +1146,19 @@ var Dashboard = {
var index = Math.floor(Math.random() * (Dashboard.metroColors.length - 1));
return Dashboard.metroColors[index];
+ },
+
+ getMetroColor: function (str) {
+
+ if (str) {
+ var char = str.substr(0,1).charCodeAt();
+ var index = String(char).substr(char.length,1);
+
+ return Dashboard.metroColors[index];
+ }else {
+ return Dashboard.getRandomMetroColor();
+ }
+
}
};