diff options
| author | neauoire <aliceffekt@gmail.com> | 2019-11-10 09:15:28 -0500 |
|---|---|---|
| committer | neauoire <aliceffekt@gmail.com> | 2019-11-10 09:15:28 -0500 |
| commit | e90f0c7fb179c19ccee22b01cc8077cdd009c49a (patch) | |
| tree | d958bd543aac47c67882556bda56d751599eb8a0 | |
| parent | 2c7becbe4b0defa6a6e80d46ca312fd028f1075d (diff) | |
Catch invalid colors
| -rw-r--r-- | editor/scripts/lib/theme.js | 18 | ||||
| -rw-r--r-- | 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 @@ <svg width="96px" height="64px" xmlns="http://www.w3.org/2000/svg" baseProfile="full" version="1.1"> <!-- Foreground --> <rect width='96' height='64' id='background' fill='#000000'></rect> - <circle cx='24' cy='24' r='8' id='f_high' fill='#00f92f'></circle> - <circle cx='40' cy='24' r='8' id='f_med' fill='#fffc36'></circle> + <circle cx='24' cy='24' r='8' id='f_high' fill='#fffc36'></circle> + <circle cx='40' cy='24' r='8' id='f_med' fill='#00f92f'></circle> <circle cx='56' cy='24' r='8' id='f_low' fill='#ff331c'></circle> <circle cx='72' cy='24' r='8' id='f_inv' fill='#002bfb'></circle> <!-- Background --> <circle cx='24' cy='40' r='8' id='b_high' fill='#ffffff'></circle> - <circle cx='40' cy='40' r='8' id='b_med' fill='#00fbfe '></circle> + <circle cx='40' cy='40' r='8' id='b_med' fill='#00fbfe'></circle> <circle cx='56' cy='40' r='8' id='b_low' fill='#00c7c9'></circle> <circle cx='72' cy='40' r='8' id='b_inv' fill='#cacaca'></circle> </svg>
\ No newline at end of file |
