Created
October 20, 2021 03:43
-
-
Save fischgeek/a10a3acac5abdca9fe81cf7ff359b329 to your computer and use it in GitHub Desktop.
Scriptable Utils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function baseGrad() { | |
let g = new LinearGradient() | |
g.locations = [0, 1] | |
return g | |
} | |
function gradBaseBlackTop(clr) { | |
let g = baseGrad() | |
g.colors = [ | |
new Color("141414"), | |
new Color(clr) | |
] | |
return g | |
} | |
function gradBaseBlackBottom(clr) { | |
let g = baseGrad() | |
g.colors = [ | |
new Color(clr), | |
new Color("141414") | |
] | |
return g | |
} | |
class Grads { | |
blackToBlue() { return gradBaseBlackTop("13233F") } | |
blueToBlack() { return gradBaseBlackBottom("13233F") } | |
} | |
module.exports.Grads = () => { | |
return new Grads() | |
} | |
class DT { | |
gethr() { | |
let dw = new Date() | |
let d = dw.getDate().toString() | |
let df = new DateFormatter() | |
df.dateFormat = "h" | |
return df.string(dw) | |
} | |
getAbbrDow() { | |
let dw = new Date() | |
let d = dw.getDate().toString() | |
let df = new DateFormatter() | |
df.dateFormat = "E" | |
return df.string(dw) | |
} | |
} | |
module.exports.DT = () => { | |
return new DT() | |
} | |
class Fonts { | |
mono(s) { | |
// return new Font("Courier", s) | |
return new Font("DB LCD Temp", s) | |
} | |
clock(s) { | |
return new Font("DB LCD Temp", s) | |
} | |
} | |
module.exports.Fonts = () => { | |
return new Fonts() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment