Hi
I would like to add some color to a few Color Wells, I have found various ways to do this, but they all seem to involve
RGB colors, the colors I want to add are LAB which are pulled from Indesign, I can’t seem to find anything that can convert LAB to RGB
to be able to work, if such a thing exists that is.
I am working in Indesign and getting the LAB values from PANTONE spot color’s Coated and Uncoated
and then I’m trying to take the values and have the colour shown in the colour well
I have adapted this code which was originally set up for CMYK colours, written by Shane from here
https://macscripter.net/viewtopic.php?id=41741
In xcode I have a property
property NSColor : class "NSColor"
a colour well property Color_1 : missing value (only 1 at the moment until I can figure the rest out)
This gets the LAB colours from an Indesign project (works great)
trying to get the LAB value’s to fill Color Wells is the issue
tell application "Adobe InDesign CC 2019"
tell document 1
activate
--delete unused swatches
set allSwatches to every swatch
set swatchCount to count of allSwatches
repeat with i from 1 to swatchCount
set thisSwatch to item i of allSwatches
if name of thisSwatch is not "None" and space of thisSwatch is LAB then
set swatchColor to color value of thisSwatch
set lll to ((item 1 of swatchColor) as integer)
set aaa to ((item 2 of swatchColor) as integer)
set bbb to ((item 3 of swatchColor) as integer)
set swatchMix to result
set swatchMix to (" L " & lll & " A " & aaa & " B " & bbb)
display dialog {{name of thisSwatch} & swatchMix} as string
end if
end repeat
end tell
end tell
cheers