computed colors support
This commit is contained in:
parent
5881c13adc
commit
8d2f2866f6
6 changed files with 92 additions and 13 deletions
|
@ -42,7 +42,7 @@ const v1OnlyNames = [
|
|||
].map(_ => _ + 'ColorLocal')
|
||||
|
||||
const colorConvert = (color) => {
|
||||
if (color === 'transparent') {
|
||||
if (color.startsWith('--') || color === 'transparent') {
|
||||
return color
|
||||
} else {
|
||||
return hex2rgb(color)
|
||||
|
@ -409,7 +409,9 @@ export default {
|
|||
}
|
||||
|
||||
keys.forEach(key => {
|
||||
this[key + 'ColorLocal'] = rgb2hex(colors[key])
|
||||
const color = colors[key]
|
||||
const hex = rgb2hex(colors[key])
|
||||
this[key + 'ColorLocal'] = hex === '#aN' ? color : hex
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -347,6 +347,20 @@
|
|||
:label="$t('settings.text')"
|
||||
/>
|
||||
<ContrastRatio :contrast="previewContrast.btnText" />
|
||||
<h4>{{ $t('settings.style.advanced_colors.pressed') }}</h4>
|
||||
<ColorInput
|
||||
v-model="btnPressedColorLocal"
|
||||
name="btnPressedColor"
|
||||
:fallback="previewTheme.colors.btnPressed"
|
||||
:label="$t('settings.background')"
|
||||
/>
|
||||
<ColorInput
|
||||
v-model="btnPressedTextColorLocal"
|
||||
name="btnPressedTextColor"
|
||||
:fallback="previewTheme.colors.btnPressedText"
|
||||
:label="$t('settings.text')"
|
||||
/>
|
||||
<ContrastRatio :contrast="previewContrast.btnText" />
|
||||
</div>
|
||||
<div class="color-item">
|
||||
<h4>{{ $t('settings.style.advanced_colors.borders') }}</h4>
|
||||
|
@ -433,7 +447,7 @@
|
|||
<ColorInput
|
||||
v-model="lightBgColorLocal"
|
||||
name="lightBg"
|
||||
:label="$t('settings.style.advanced_colors.lightBg')"
|
||||
:label="$t('settings.background')"
|
||||
:fallback="previewTheme.colors.lightBg"
|
||||
/>
|
||||
<ColorInput
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue