zenity/internal/zenutil/osascripts/color.gojs

16 lines
339 B
Plaintext
Raw Normal View History

2021-02-18 21:20:57 -05:00
var app = Application.currentApplication()
app.includeStandardAdditions = true
app.activate()
2022-05-06 08:48:31 -04:00
ObjC.import('stdio')
ObjC.import('stdlib')
try {
var res = app.chooseColor({defaultColor: {{json .}}})
} catch (e) {
if (e.errorNumber === -128) $.exit(1)
$.dprintf(2, e)
$.exit(-1)
}
2022-03-26 20:05:52 -04:00
{'rgb(' + res.map(x => Math.round(x * 255)) + ')'}