17 lines
No EOL
343 B
Text
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+')'
|
|
} |