Skip to content

Commit

Permalink
Testing the svg background enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
meuusuario committed Apr 15, 2018
1 parent 1b46a55 commit b2e8692
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
31 changes: 24 additions & 7 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,19 @@ function updateActiveTab(tabId, changeInfo) {

if(tabURLkey in indexedColorMap) {
console.log('From the cache: ' + tabURLkey);
var colorObject = indexedColorMap[tabURLkey];
var themeProposal = {
colors: colorObject
}
let colorObject = indexedColorMap[tabURLkey];

let color = {
r: 0,
g: 0,
b: 0,
alpha: 0
};

let themeProposal = util_themePackage(color);
themeProposal.colors = colorObject;
util_custom_update(themeProposal);

} else {
currentActiveTab = tabURLkey;
//setTimeout(delayedStore, 2000);
Expand Down Expand Up @@ -195,7 +203,7 @@ browser.runtime.onMessage.addListener(notify);

function util_custom_update(themeProposal) {

// If we change the JSON objec it will affect the global reference
// If we change the JSON objec it will affect the global reference
//let themeProposal2 = Object.assign({}, themeProposal, {})
let themeProposal2 = JSON.parse(JSON.stringify(themeProposal));

Expand Down Expand Up @@ -230,12 +238,21 @@ function util_themePackage(color) {
let colorObject = {
accentcolor : 'rgb('+color.r+','+color.g+','+color.b+')',
textcolor : 'rgb('+textC+','+textC+','+textC+')',
toolbar : 'rgb('+color.r+','+color.g+','+color.b+')',
toolbar : 'rgb('+color.r+','+color.g+','+color.b+')',
toolbar_bottom_separator : 'rgb('+color.r+','+color.g+','+color.b+')'
};

let themeProposal = {
colors: colorObject
colors : colorObject,
images : {
// headerURL : 'background.svg',
additional_backgrounds : [ "background.svg"]
},
properties: {
additional_backgrounds_alignment : [ "top" ],
additional_backgrounds_tiling : [ "repeat" ]
}

}

return themeProposal;
Expand Down
11 changes: 11 additions & 0 deletions src/background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b2e8692

Please sign in to comment.