cleanup and fixes

This commit is contained in:
Henry Jameson 2018-11-15 17:17:20 +03:00
parent 75cdcc40db
commit edb429e307
2 changed files with 2 additions and 16 deletions

View file

@ -288,19 +288,6 @@ export default {
}, },
setCustomTheme () { setCustomTheme () {
if (!this.bgColorLocal && !this.btnColorLocal && !this.linkColorLocal) {
// reset to picked themes
}
const rgb = (hex) => {
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
return result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null
}
this.$store.dispatch('setOption', { this.$store.dispatch('setOption', {
name: 'customTheme', name: 'customTheme',
value: this.currentTheme value: this.currentTheme
@ -310,6 +297,8 @@ export default {
clearV1 () { clearV1 () {
this.bgOpacityLocal = undefined this.bgOpacityLocal = undefined
this.fgOpacityLocal = undefined this.fgOpacityLocal = undefined
this.fgTextColorLocal = undefined
this.fgLinkColorLocal = undefined this.fgLinkColorLocal = undefined
this.btnColorLocal = undefined this.btnColorLocal = undefined
@ -371,7 +360,6 @@ export default {
} }
const keys = new Set(version !== 1 ? Object.keys(colors) : []) const keys = new Set(version !== 1 ? Object.keys(colors) : [])
console.log(keys)
if (version === 1) { if (version === 1) {
// V1 ignores the rest // V1 ignores the rest
this.clearV1() this.clearV1()

View file

@ -99,9 +99,7 @@ const alphaBlend = (fg, fga, bg) => {
const invert = (rgb) => { const invert = (rgb) => {
return 'rgb'.split('').reduce((acc, c) => { return 'rgb'.split('').reduce((acc, c) => {
console.log(rgb[c])
acc[c] = 255 - rgb[c] acc[c] = 255 - rgb[c]
console.log(acc[c])
return acc return acc
}, {}) }, {})
} }