Skip to content

Commit

Permalink
[refactor] switch to rounding theme colours
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieFox committed Jan 21, 2020
1 parent b734855 commit db0e515
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nightTab",
"version": "4.29.0",
"version": "4.31.0",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"main": "index.js",
"scripts": {
Expand Down
24 changes: 12 additions & 12 deletions src/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ var theme = (function() {
object: state.get.current(),
path: "theme.accent.rgb",
newValue: {
r: parseInt(rgb.r, 10),
g: parseInt(rgb.g, 10),
b: parseInt(rgb.b, 10)
r: Math.round(rgb.r),
g: Math.round(rgb.g),
b: Math.round(rgb.b)
}
});
};
Expand All @@ -155,9 +155,9 @@ var theme = (function() {
object: state.get.current(),
path: "theme.color.hsl",
newValue: {
h: parseInt(hsl.h, 10),
s: parseInt(hsl.s, 10),
l: parseInt(hsl.l, 10)
h: Math.round(hsl.h),
s: Math.round(hsl.s),
l: Math.round(hsl.l)
}
});
},
Expand All @@ -167,9 +167,9 @@ var theme = (function() {
object: state.get.current(),
path: "theme.color.rgb",
newValue: {
r: parseInt(rgb.r, 10),
g: parseInt(rgb.g, 10),
b: parseInt(rgb.b, 10)
r: Math.round(rgb.r),
g: Math.round(rgb.g),
b: Math.round(rgb.b)
}
});
}
Expand Down Expand Up @@ -1381,7 +1381,7 @@ var theme = (function() {
} else if (rgb[key] > 255) {
rgb[key] = 255;
};
rgb[key] = parseInt(rgb[key], 10);
rgb[key] = Math.round(rgb[key]);
};
if (index < 10) {
index = "0" + index;
Expand Down Expand Up @@ -1550,7 +1550,7 @@ var theme = (function() {
} else if (rgb[colorKey] > 255) {
rgb[colorKey] = 255;
};
rgb[colorKey] = parseInt(rgb[colorKey], 10);
rgb[colorKey] = Math.round(rgb[colorKey]);
};
var themePresetBackground = helper.node("span|class:theme-preset-background-0" + i);
themePresetBackground.style.setProperty("background-color", "rgb(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ")");
Expand Down Expand Up @@ -1633,7 +1633,7 @@ var theme = (function() {
} else if (rgb[colorKey] > 255) {
rgb[colorKey] = 255;
};
rgb[colorKey] = parseInt(rgb[colorKey], 10);
rgb[colorKey] = Math.round(rgb[colorKey]);
};
var themeCustomBackground = helper.node("span|class:theme-custom-background-0" + i);
themeCustomBackground.style.setProperty("background-color", "rgb(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ")");
Expand Down
2 changes: 1 addition & 1 deletion src/js/version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var version = (function() {

var current = "4.29.0";
var current = "4.31.0";

var name = "Naughty Goose";

Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nightTab",
"short_name": "nightTab",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"version": "4.29.0",
"version": "4.31.0",
"manifest_version": 2,
"chrome_url_overrides": {
"newtab": "index.html"
Expand Down

0 comments on commit db0e515

Please sign in to comment.