Fix button issue

This commit is contained in:
Julien Nahum 2024-01-24 17:54:14 +01:00
parent 3a25178697
commit d71bdf533e
1 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,9 @@ export default {
methods: { methods: {
getTextColor (bgColor, lightColor = '#FFFFFF', darkColor = '#000000') { getTextColor (bgColor, lightColor = '#FFFFFF', darkColor = '#000000') {
if (!bgColor) {
return darkColor
}
const color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor const color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor
const r = parseInt(color.substring(0, 2), 16) // hexToR const r = parseInt(color.substring(0, 2), 16) // hexToR
const g = parseInt(color.substring(2, 4), 16) // hexToG const g = parseInt(color.substring(2, 4), 16) // hexToG