fix: Properly handle adding new tags through multiselect

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-11-13 15:54:20 +01:00
parent bb51988ddb
commit 488cdbcd93
3 changed files with 12 additions and 22 deletions

View File

@@ -25,7 +25,7 @@ import chroma from 'chroma-js'
export default {
methods: {
textColor(hex) {
return chroma(hex).get('lab.l') > 50 ? '#000000' : '#ffffff'
return chroma(hex ?? 'ffffff').get('lab.l') > 50 ? '#000000' : '#ffffff'
},
colorIsValid(hex) {
const re = /[A-Fa-f0-9]{6}/