Fix button issue
This commit is contained in:
parent
3a25178697
commit
d71bdf533e
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue