2022-05-06 08:48:31 -04:00
|
|
|
ObjC.import('stdio')
|
|
|
|
ObjC.import('stdlib')
|
2022-06-01 19:00:08 -04:00
|
|
|
{{template "common" .}}
|
2022-05-06 08:48:31 -04:00
|
|
|
|
|
|
|
try {
|
2022-06-01 19:00:08 -04:00
|
|
|
var res = app.chooseColor({defaultColor: {{json .Color}}})
|
2022-05-06 08:48:31 -04:00
|
|
|
} 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)) + ')'}
|