From 72d5307fd9b9b8bf4f079217bde8280e206e150d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 6 Jul 2026 19:43:20 +0300 Subject: [PATCH] fix palette editor --- src/components/palette_editor/palette_editor.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/palette_editor/palette_editor.vue b/src/components/palette_editor/palette_editor.vue index 8fe6ba5c4..80c55d635 100644 --- a/src/components/palette_editor/palette_editor.vue +++ b/src/components/palette_editor/palette_editor.vue @@ -16,7 +16,7 @@ @update:model-value="value => updatePalette(key, value)" /> @@ -136,11 +136,15 @@ const mobile = computed(() => { }) const contrast = computed(() => { + if (props.modelValue == null) return null const bg = hex2rgb(props.modelValue.bg) + const text = hex2rgb(props.modelValue.text) + const link = hex2rgb(props.modelValue.link) + if (text == null || link == null) return null return { - text: hints(getContrastRatio(bg, hex2rgb(props.modelValue.text))), - link: hints(getContrastRatio(bg, hex2rgb(props.modelValue.link))), + text: hints(getContrastRatio(bg, text)), + link: hints(getContrastRatio(bg, link)), } })