zenity/internal/zenutil/osascripts/color.gots
2020-01-19 12:53:20 +00:00

17 lines
No EOL
343 B
Text

var app = Application.currentApplication()
app.includeStandardAdditions = true
app.activate()
var opts = {}
{{if .Color -}}
opts.defaultColor = {{.Color}}
{{end -}}
var res = app.chooseColor(opts)
if (Array.isArray(res)) {
res[0] = Math.round(255*res[0])
res[1] = Math.round(255*res[1])
res[2] = Math.round(255*res[2])
'rgb('+res+')'
}