Tuesday, August 20, 2019

#1 2019-08-14 03:24:49 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 698

how to add colour to colour well using LAB

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

Applescript:

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


Applescript:

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

Last edited by Budgie (2019-08-15 02:01:10 pm)


Cheers
Budgie

"There's no shame in accepting aid from others... but perhaps there is a  responsibility."    - Batman

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)