zenity/internal/zenutil/osascripts/color.gojs
2022-06-02 00:00:08 +01:00

13 lines
No EOL
273 B
Text

ObjC.import('stdio')
ObjC.import('stdlib')
{{template "common" .}}
try {
var res = app.chooseColor({defaultColor: {{json .Color}}})
} catch (e) {
if (e.errorNumber === -128) $.exit(1)
$.dprintf(2, e)
$.exit(-1)
}
{'rgb(' + res.map(x => Math.round(x * 255)) + ')'}