diff --git a/desktop/sources/scripts/lib/theme.js b/desktop/sources/scripts/lib/theme.js index 87e3ab3..8ae7708 100644 --- a/desktop/sources/scripts/lib/theme.js +++ b/desktop/sources/scripts/lib/theme.js @@ -28,7 +28,7 @@ function Theme (_default) { this.load = function (data) { const theme = parse(data) - if (!validate(theme)) { console.warn('Theme', 'Not a theme', theme); return } + if (!validate(theme)) { return } console.log('Theme', `Loaded theme!`) this.el.innerHTML = `:root { --background: ${theme.background}; --f_high: ${theme.f_high}; --f_med: ${theme.f_med}; --f_low: ${theme.f_low}; --f_inv: ${theme.f_inv}; --b_high: ${theme.b_high}; --b_med: ${theme.b_med}; --b_low: ${theme.b_low}; --b_inv: ${theme.b_inv}; }` localStorage.setItem('theme', JSON.stringify(theme)) diff --git a/desktop/sources/scripts/library.js b/desktop/sources/scripts/library.js index 9a2c756..647d6a6 100644 --- a/desktop/sources/scripts/library.js +++ b/desktop/sources/scripts/library.js @@ -91,4 +91,21 @@ function Library (ronin) { this.of = function (h, k) { return h[k] } + + // Math + + this.add = function (a, b) { + return a + b + } + + this.sub = function (a, b) { + return a - b + } + + this.mul = function (a, b) { + return a * b + } + this.div = function (a, b) { + return a / b + } } diff --git a/examples/guides.lisp b/examples/guides.lisp index 079752f..c6bff1a 100644 --- a/examples/guides.lisp +++ b/examples/guides.lisp @@ -16,5 +16,21 @@ (pos 0 (of (frame) "h"))) 1 "red") - (stroke (line (pos 0 0) (pos (of (frame) "w") (of (frame) "h"))) 1 "red") + (stroke + (line + (pos (div (of (frame) "w") 2) 0) + (pos (div (of (frame) "w") 2) (of (frame) "h"))) + 1 "red") + + (stroke + (line + (pos 0 (div (of (frame) "h") 2)) + (pos (div (of (frame) "w") 2) (of (frame) "h"))) + 1 "#72dec2") + + (stroke + (line + (pos (div (of (frame) "w") 2) 0) + (pos (of (frame) "w") (div (of (frame) "h") 2))) + 1 "#72dec2") ) \ No newline at end of file