diff options
| author | eal <eal@waifu.club> | 2017-12-23 19:52:16 +0200 |
|---|---|---|
| committer | eal <eal@waifu.club> | 2017-12-23 19:52:16 +0200 |
| commit | b67c50606250d2c2d4b3750affdbab6525872f2a (patch) | |
| tree | bb45758ecab1ef87976c07d37b6936a3531e2b13 /src/components/style_switcher/style_switcher.js | |
| parent | 581e3e836ad6c8a9a211eb09d7eaa1fbaf830da2 (diff) | |
| parent | 6fd309452a1d8243257bc8544429ea53a26ce8a4 (diff) | |
Merge branch 'develop' into feature/normal-emoji-completion
Diffstat (limited to 'src/components/style_switcher/style_switcher.js')
| -rw-r--r-- | src/components/style_switcher/style_switcher.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js index b1359d13..a762f914 100644 --- a/src/components/style_switcher/style_switcher.js +++ b/src/components/style_switcher/style_switcher.js @@ -1,3 +1,5 @@ +import { rgbstr2hex } from '../../services/color_convert/color_convert.js' + export default { data () { return { @@ -19,13 +21,6 @@ export default { }) }, mounted () { - const rgbstr2hex = (rgb) => { - if (rgb[0] === '#') { - return rgb - } - rgb = rgb.match(/\d+/g) - return `#${((Number(rgb[0]) << 16) + (Number(rgb[1]) << 8) + Number(rgb[2])).toString(16)}` - } this.bgColorLocal = rgbstr2hex(this.$store.state.config.colors['base00']) this.fgColorLocal = rgbstr2hex(this.$store.state.config.colors['base02']) this.textColorLocal = rgbstr2hex(this.$store.state.config.colors['base05']) |
