Added colors in chrome android

This commit is contained in:
Kasper Rynning-Tønnesen
2015-07-30 12:46:42 +02:00
parent 6fc9a7c392
commit 51a11301a2
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -141,14 +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)));
console.log(colorThief.getColor(img));
//$("meta[name=theme-color]").attr("content", Helper.rgbToHex(colorThief.getColor(img)));
};
img.crossOrigin = 'Anonymous';