From e90f0c7fb179c19ccee22b01cc8077cdd009c49a Mon Sep 17 00:00:00 2001 From: neauoire Date: Sun, 10 Nov 2019 09:15:28 -0500 Subject: Catch invalid colors --- editor/scripts/lib/theme.js | 18 +++++++++--------- themes/zxspectrum.svg | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/editor/scripts/lib/theme.js b/editor/scripts/lib/theme.js index 85fcc63..e218392 100644 --- a/editor/scripts/lib/theme.js +++ b/editor/scripts/lib/theme.js @@ -144,15 +144,15 @@ function Theme (client) { function isValid (json) { if (!json) { return false } - if (!json.background) { return false } - if (!json.f_high) { return false } - if (!json.f_med) { return false } - if (!json.f_low) { return false } - if (!json.f_inv) { return false } - if (!json.b_high) { return false } - if (!json.b_med) { return false } - if (!json.b_low) { return false } - if (!json.b_inv) { return false } + if (!json.background || !isColor(json.background)) { return false } + if (!json.f_high || !isColor(json.f_high)) { return false } + if (!json.f_med || !isColor(json.f_med)) { return false } + if (!json.f_low || !isColor(json.f_low)) { return false } + if (!json.f_inv || !isColor(json.f_inv)) { return false } + if (!json.b_high || !isColor(json.b_high)) { return false } + if (!json.b_med || !isColor(json.b_med)) { return false } + if (!json.b_low || !isColor(json.b_low)) { return false } + if (!json.b_inv || !isColor(json.b_inv)) { return false } return true } diff --git a/themes/zxspectrum.svg b/themes/zxspectrum.svg index f47caae..f06763b 100644 --- a/themes/zxspectrum.svg +++ b/themes/zxspectrum.svg @@ -1,13 +1,13 @@ - - + + - + \ No newline at end of file -- cgit v1.2.3