extract settings from main

This commit is contained in:
Stewart Allen 2022-02-18 18:42:08 -05:00
commit 0e3074229a
5 changed files with 524 additions and 496 deletions

View file

@ -4,7 +4,7 @@
(function () {
const { kiri, moto } = self;
const { kiri, moto, data } = self;
function parseOpt(ov) {
let opt = {}, kv, kva;
@ -46,6 +46,10 @@ function js2o(s,def) {
}
}
function ls2o(key,def) {
return js2o(data.local.getItem(key),def);
}
// split 24 bit color into [ r, g, b ]
function rgb(c) {
return [ (c >> 16) & 0xff, (c >> 8) & 0xff, c & 0xff ];
@ -96,6 +100,7 @@ kiri.utils = {
ajax,
o2js,
js2o,
ls2o,
avgc,
rgb,
a2c