Remove double dash from theme cmd. Update docstring. Add example.
This commit is contained in:
parent
5fb97a072b
commit
d3530c99fb
@ -182,8 +182,8 @@ function Library (ronin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.theme = (variable, el = document.documentElement) => {
|
this.theme = (variable, el = document.documentElement) => {
|
||||||
// ex. styleprop('--f_high') to get css variable value
|
// ex. (theme "f_main") -> :root { --f_main: "#fff" }
|
||||||
return getComputedStyle(el).getPropertyValue(variable)
|
return getComputedStyle(el).getPropertyValue(`--${variable}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Math
|
// Math
|
||||||
|
30
examples/theme.lisp
Normal file
30
examples/theme.lisp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
((clear)
|
||||||
|
(def col
|
||||||
|
(lambda
|
||||||
|
(i)
|
||||||
|
(of
|
||||||
|
((theme "f_high")
|
||||||
|
(theme "f_med")
|
||||||
|
(theme "f_low")
|
||||||
|
(theme "f_inv")
|
||||||
|
(theme "b_high")
|
||||||
|
(theme "b_med")
|
||||||
|
(theme "b_low")
|
||||||
|
(theme "b_inv"))
|
||||||
|
(mod i 8))))
|
||||||
|
(def rec
|
||||||
|
(lambda
|
||||||
|
(v i)
|
||||||
|
(if (gt v 0)
|
||||||
|
((fill
|
||||||
|
(circle
|
||||||
|
(add
|
||||||
|
(div (of (frame) "w") 1.6)
|
||||||
|
(mul 1.5 v))
|
||||||
|
(mul 10 v)
|
||||||
|
(mul v (div v 5)))
|
||||||
|
(col i))
|
||||||
|
(rec
|
||||||
|
(sub v 3)
|
||||||
|
(add i 1))))))
|
||||||
|
(rec 40 0))
|
Loading…
x
Reference in New Issue
Block a user