Added colors in chrome android

This commit is contained in:
Kasper Rynning-Tønnesen
2015-07-30 12:45:04 +02:00
parent 9ac2f14c6b
commit 6fc9a7c392
4 changed files with 14 additions and 1 deletions

View File

@@ -141,11 +141,14 @@ var Youtube = {
setBGimage: function(id){
if(id !== undefined)
{
console.log($("meta[name=theme-color]").attr("content", ""));
var img = new Image();
img.onload = function ()
{
var colorThief = new ColorThief();
document.getElementsByTagName("body")[0].style.backgroundColor = Helper.rgbToHsl(colorThief.getColor(img));
$("meta[name=theme-color]").attr("content", Helper.rgbToHex(colorThief.getColor(img)));
};
img.crossOrigin = 'Anonymous';