Highlighted

Branding Color Guide

Adobe Community Professional ,
Dec 24, 2019

Copy link to clipboard

Copied

Recently I’ve been working on a client project that creates branding guides via scripting. Questions about Pantone CMYK and RGB color simulations of the solid inks come up occasionally from users wanting there to be an "official" set of conversion values. There are various conversion charts available on the web—including Pantone’s own Bridge libraries—all of which have color management problems because they usually assume the appearance of RGB and CMYK values is the same for all devices. For the Pantone + Bridge process CMYK simulation libraries Pantone doesn’t provide any information on what the expected press conditions are, and the Bridge CMYK values display inconsistently relative to the more accurate solid ink Lab color display.

For the scripted guide I have defined the expected CMYK and RGB destinations for the values. Each swatch label includes two CMYK values—the conversion to Coated GRACol 2013 and Uncoated GRACol 2013. I chose GRACol because it is a common sheetfed press profile, and it is the paper stock that usually causes the greatest shift in color appearance. There is also a conversion from Lab to sRGB, the sRGB’s HEX value, and a note on whether the solid ink color is outside of the coated CMYK color space’s gamut.

The format is this:

Screen Shot 4.png

You can download a zip archive of the InDesign Pantone swatch book (2443 colors) along with more detailed notes, the GRACol profiles, and the AppleScript (OSX only) here. The guide’s fonts are the Vista Sans family available from Typekit—there is also a PDF/X-4 version:

 

https://adobe.ly/39gljX4

 

https://adobe.ly/39gljX4

TOPICS
How to, Print, Scripting

Views

859

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Branding Color Guide

Adobe Community Professional ,
Dec 24, 2019

Copy link to clipboard

Copied

Recently I’ve been working on a client project that creates branding guides via scripting. Questions about Pantone CMYK and RGB color simulations of the solid inks come up occasionally from users wanting there to be an "official" set of conversion values. There are various conversion charts available on the web—including Pantone’s own Bridge libraries—all of which have color management problems because they usually assume the appearance of RGB and CMYK values is the same for all devices. For the Pantone + Bridge process CMYK simulation libraries Pantone doesn’t provide any information on what the expected press conditions are, and the Bridge CMYK values display inconsistently relative to the more accurate solid ink Lab color display.

For the scripted guide I have defined the expected CMYK and RGB destinations for the values. Each swatch label includes two CMYK values—the conversion to Coated GRACol 2013 and Uncoated GRACol 2013. I chose GRACol because it is a common sheetfed press profile, and it is the paper stock that usually causes the greatest shift in color appearance. There is also a conversion from Lab to sRGB, the sRGB’s HEX value, and a note on whether the solid ink color is outside of the coated CMYK color space’s gamut.

The format is this:

Screen Shot 4.png

You can download a zip archive of the InDesign Pantone swatch book (2443 colors) along with more detailed notes, the GRACol profiles, and the AppleScript (OSX only) here. The guide’s fonts are the Vista Sans family available from Typekit—there is also a PDF/X-4 version:

 

https://adobe.ly/39gljX4

 

https://adobe.ly/39gljX4

TOPICS
How to, Print, Scripting

Views

860

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 24, 2019 10
Adobe Community Professional ,
Dec 24, 2019

Copy link to clipboard

Copied

Great! Thanks Rob 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 24, 2019 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

Many thanks for all the work done!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 21, 2020 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

What does this script actually intend to do?

I tried it on a blank document and get the error "There are no user defined swatches in theis document"
Then added a PMS color and stiill got the same error, also added a rectangle with that color. Still i keeps returning the error.

EDIT
i got it, colors need to be added as LAB

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 21, 2020 0
Adobe Community Professional ,
Jan 22, 2020

Copy link to clipboard

Copied

Yes, if the task is a branding color you would want to start with the device independent Lab color space, and get the process colors from the master Lab color. Starting with an RGB or CMYK swatch would not work because the appearance of those device dependent spaces changes depending on the color profile assignment.

 

The PANTONE+ Solid libraries have been defined as Lab since CS6, and other solid ink libraries like ANPA, TOYO, HKS, and DIC are  defined as Lab. A solid ink swatch could be a physical reference for the master brand color. One could also use a colorimeter to get a Lab reading from any paint swatch or color object.

 

If you don’t want to use GRACol, the CMYK conversion profiles can be changed via the variables at the top of the script—the profile names would be case sensitive.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 22, 2020 0
Participant ,
Sep 26, 2020

Copy link to clipboard

Copied

Really neat, Rob!
I'm responsible for the whole prepress/color workflow within our company (agency+offset printing) and curious how you get the values.

If I understand correctly you use the LAB values defined in the PANTONE swatches to do all color conversions?
So
LAB -> CMYK coated/uncoated
LAB -> sRGB -> HEX

How do you identify if a color is within range?

 

And last question: how would you change the used profile in your script? In Europe we use PSO (un)coated v3 (or resp. the previous ISO coated v2).
If I open the script in Apple's script editor, script editor crashes. Plain text/code editor shows just gibberish. I downloaded the *.scrpt multiple times but I think something is broken here...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 26, 2020 0
Adobe Community Professional ,
Sep 27, 2020

Copy link to clipboard

Copied

Yes the conversions are from Pantone’s Solid Color Lab values, which would be instrument read from the printed solid inks. I used Relative Colorimetric and Black Point Compensation for the conversions—the Intent and BPC would have an affect on the final CMYK values when the color is out-of-gamut to the destination CMYK space.

 

How do you identify if a color is within range?

If you mean is the color in the CMYK gamut, you can use the Color panel to check gamut.

 

If you set the Pantone color to Lab in the Color panel out-of-gamut colors get a yellow triangle. The gamut would be defined by the document’s assigned CMYK profile—uncoated would be smaller than coated.

 

 

Screen Shot 3.pngScreen Shot 4.png

 

 

My AppleScript does a Lab>CMYK>Lab conversion and checks if the returned Lab values have changed significantly—changed Lab values would indicate the color is out-of-gamut and I note it in the chart.

 

Sorry to hear the script isn’t running for you. What OS are you using? I haven’t tested on Catalina.

 

Make sure you have a document open and the Swatch panel contains the Pantone swatches you want to get.

 

When I get a chance I’ll run it with your ISO profiles.

 

Here’s the code. There are two global variables at the top which set the CMYK profiles:

 

 

 

(* 
Creates a swatch grid with conversion info for every Lab mode swatch in the frontmost document
Rob Day 2015-2019 
*)

--the CMYK Coated destination profile
global coatedProfile
--set coatedProfile to "Coated GRACoL 2013"
set coatedProfile to "ISO Coated v2 300% (ECI)"

--the CMYK Uncoated destination profile
global uncoatedProfile
--set uncoatedProfile to "Uncoated GRACoL 2013"
set uncoatedProfile to "PSO Uncoated v3 (FOGRA52)"

--the uncoated conversion values
global uncoatedCMYK
set uncoatedCMYK to ""


tell application id "com.adobe.indesign"
	activate
	
	--check for an open doc
	if (count documents) is equal to 0 then
		display dialog "Please open a document" buttons " OK " default button 1 with icon caution
		return -128
	end if
	
	-------------------Display a Dialog ----------------------
	
	set labelwidth to 50
	set myDialog to make dialog with properties {name:"Page Size & Grid"}
	tell myDialog
		tell (make dialog column)
			tell (make border panel)
				tell (make dialog column)
					
					--width
					tell (make dialog row)
						make static text with properties {static label:"Page Width"}
						set myPWEdit to make measurement editbox with properties ¬
							{edit units:inches, edit value:612, min width:labelwidth}
					end tell
					
					--height
					tell (make dialog row)
						make static text with properties {static label:"Page Height"}
						set myPHEdit to make measurement editbox with properties ¬
							{edit units:inches, edit value:792, min width:labelwidth}
					end tell
					
					--Margin
					tell (make dialog row)
						make static text with properties {static label:"Page Margin"}
						set mymargins to make measurement editbox with properties ¬
							{edit units:inches, edit value:36, min width:labelwidth}
					end tell
					
					--Num Columns
					tell (make dialog row)
						make static text with properties {static label:"Columns"}
						set mycols to make real editbox with properties ¬
							{edit value:2, min width:labelwidth}
					end tell
					
					--Num Rows
					tell (make dialog row)
						make static text with properties {static label:"Rows"}
						set myrows to make real editbox with properties ¬
							{edit value:5, min width:labelwidth}
					end tell
					
				end tell
			end tell
		end tell
	end tell
	
	-------------------Display Results ----------------------
	
	set myResult to show myDialog
	if myResult = true then
		set pagew to edit value of myPWEdit
		set pageh to edit value of myPHEdit
		set mar to edit value of mymargins
		set |ncols| to edit value of mycols
		set |nrows| to edit value of myrows
		set tmar to mar
		set rmar to mar
		set lmar to mar
		set bmar to mar
		set gut to 90
	else
		return
	end if
	destroy myDialog
	
	-------------------Save preferences for reset-----------------------
	
	--the active document
	set doc to active document
	set appviewprefs to properties of view preferences
	set oldCS to properties of color settings
	set docviewprefs to properties of view preferences of doc
	set docprefs to properties of doc
	
	
	
	-------------------Make Swatch Document-----------------------
	
	--make sure the profiles are sRGB, GRACol, with BPS, and relative colorimetric
	set properties of color settings to {use BPC:true, working space CMYK:coatedProfile, CMYK policy:preserve embedded profiles, engine:"Adobe (ACE)", missing ask when opening:false, mismatch ask when opening:false, mismatch ask when pasting:false, enable color management:true, working space RGB:"sRGB IEC61966-2.1", RGB policy:preserve embedded profiles, accurate LAB spots:true, intent:relative colorimetric}
	
	--check for Lab defined swatches
	set mySwatches to every swatch of active document whose space is LAB
	
	if (count of mySwatches) is 0 then
		display dialog "There are no user defined swatches in theis document"
		return
	end if
	
	--get page orientation preference
	if pageh is greater than pagew then
		set orient to portrait
	else
		set orient to landscape
	end if
	
	--dialog returns points so set the application units 
	set properties of view preferences to {horizontal measurement units:points, vertical measurement units:points, ruler origin:page origin}
	set docprefs to {page height:pageh, page orientation:orient, facing pages:false, page width:pagew}
	
	--make a new doc with no existing swatches for getting the uncoated CMYK values
	set uncoatedDoc to make new document with properties {facing pages:false, document preferences:docprefs, name:"Uncoated Temp"}
	set properties of uncoatedDoc to {CMYK profile:uncoatedProfile, RGB profile:"sRGB IEC61966-2.1", solid color intent:relative colorimetric, accurate LAB spots:true}
	my deleteSwatches(uncoatedDoc)
	
	--make a new doc with no existing swatches or styles for building the swatch matrix
	set swatchDoc to make new document with properties {facing pages:false, document preferences:docprefs, name:"Swatches"}
	set properties of swatchDoc to {CMYK profile:coatedProfile, RGB profile:"sRGB IEC61966-2.1", solid color intent:relative colorimetric, accurate LAB spots:true}
	my deleteSwatches(swatchDoc)
	my deleteStyles(swatchDoc)
	
	--the swatch document
	tell swatchDoc
		
		set zero point to {0.0, 0.0}
		
		--set the master margins with extra at bottom
		set properties of margin preferences of pages of master spread 1 to {top:tmar, left:lmar, right:rmar, bottom:bmar}
		
		--the bottom swatch layer
		set swatchlayer to layer 1
		set name of swatchlayer to "Swatch Matrix"
		
		--the top label layer
		set labellayer to make new layer with properties {name:"Labels"}
		
		--the label style
		set myLabelStyle to make new paragraph style with properties {name:"LabelText", applied font:"Myriad Pro	Regular", point size:6, leading:7.5, left indent:0, fill color:"Black"}
		
		--the label name style
		set myLabelColorStyle to make new paragraph style with properties {name:"LabelColor", applied font:"Myriad Pro	Black Condensed", based on:myLabelStyle, point size:9.5, space after:4}
		
		--the gamut note style
		set mygamutStyle to make new paragraph style with properties {name:"GamutNote", applied font:"Myriad Pro	Light Italic", based on:myLabelStyle, space before:4}
		
		
		-----------------------------------matrix construction-----------------------------------------
		
		--the starting matrix point
		set xoff to lmar
		set yoff to tmar
		
		--swatch dimensions
		set fw to (pagew - (lmar + rmar + gut * (|ncols| - 1))) / |ncols|
		set fh to (pageh - (tmar + bmar + gut * (|nrows|))) / |nrows|
		
		--the loop move amounts
		set colwidth to fw + gut
		set rowheight to fh + gut
		
		--the page to place on starting with 1
		set myPage to object reference of page 1
		
		--make matrix
		repeat with i from 1 to count of items in mySwatches
			
			set z to properties of item i of mySwatches
			
			--make a swatch from list skips gradients	
			set ns to make color with properties {model:model of item i of mySwatches, space:space of item i of mySwatches, color value:color value of item i of mySwatches, name:name of item i of mySwatches}
			
			--get uncoated values from the uncoatedDoc
			my getUncoatedValues(ns, uncoatedDoc)
			
			--get label contents
			set sl to my getValues(ns, swatchDoc)
			
			--make the label
			tell myPage
				make rectangle with properties {geometric bounds:{yoff, xoff, yoff + fh, xoff + fw}, item layer:swatchlayer, fill color:ns}
				set myTextFrame to make text frame with properties {geometric bounds:{yoff + fh, xoff, yoff + fh + gut, xoff + fw}, contents:sl, item layer:labellayer}
				tell myTextFrame
					set properties of text frame preferences to {first baseline offset:cap height, inset spacing:{5, 0, 0, 0}}
					set applied paragraph style of parent story to myLabelStyle
					set applied paragraph style of paragraph 1 of parent story to myLabelColorStyle
					set applied paragraph style of last paragraph of parent story to mygamutStyle
				end tell
			end tell
			
			--change the offsets to the next place point
			if i mod |ncols| is greater than 0 then
				set xoff to xoff + colwidth
			else
				set xoff to lmar
				set yoff to yoff + rowheight
			end if
			
			--make a new page when the matrix is complete
			if i mod (|ncols| * |nrows|) is equal to 0 then
				--make a new page and reset place point
				set myPage to make page at end of active document
				
				set yoff to tmar
				set xoff to lmar
			end if
			--end try
		end repeat
	end tell
	
	--close the uncoated temp doc
	tell uncoatedDoc
		close saving no
	end tell
	
	-------------------------------Reset----------------------------------
	
	set properties of view preferences of doc to docviewprefs
	set properties of view preferences of swatchDoc to docviewprefs
	set properties of view preferences to appviewprefs
	set properties of color settings to oldCS
	set properties of doc to docprefs
	
end tell





-------------------------------Functions----------------------------------


--deletes any default swatches from the built documents
on deleteSwatches(d)
	tell application id "com.adobe.indesign"
		tell d
			set cgs to every color
			repeat with cg in cgs
				try
					delete cg
				end try
			end repeat
		end tell
	end tell
end deleteSwatches


--deletes any default swatches from the built documents
on deleteStyles(d)
	tell application id "com.adobe.indesign"
		tell d
			set ps to every paragraph style
			repeat with x in ps
				try
					delete x
				end try
			end repeat
			set cs to every character style
			repeat with z in cs
				try
					delete z
				end try
			end repeat
			
		end tell
	end tell
end deleteStyles


--get the color conversions for the provided Pantone swatch
--theColor is a Pantone coated swatch
on getValues(theColor, sdoc)
	set s to ""
	tell application id "com.adobe.indesign"
		set active document to sdoc
		tell sdoc
			--get the Pantone's Lab values
			set s to name of theColor & return
			set model of theColor to process
			set labval to color value of theColor as list
			set s to s & "Lab: " & my getValueString(labval)
			
			--duplicate and convert swatch to document CMYK  and get CMYK values
			set cmykCon to duplicate theColor
			set space of cmykCon to CMYK
			set cmykval to color value of cmykCon
			set s to s & "CMYK Coated Paper: " & my getValueString(cmykval)
			delete cmykCon
			
			--the uncoated CMYK values from a temp document assigned Uncoated GRACoL 201
			set s to s & "CMYK Uncoated Paper: " & uncoatedCMYK & "CMYK Output Intents: " & coatedProfile & " — " & uncoatedProfile & return
			
			--duplicate and convert swatch to sRGB values
			set rgbCon to duplicate theColor
			set space of rgbCon to RGB
			set rgbval to color value of rgbCon
			set s to s & "RGB (sRGB): " & my getValueString(rgbval)
			delete rgbCon
			
			--convert sRGB to HEX notation
			set s to s & "HEX (sRGB): " & my convertRGB(round item 1 of rgbval, round item 2 of rgbval, round item 3 of rgbval) & return
			
			--check gamut
			set s to s & my gamutCheck(theColor, sdoc)
		end tell
		--end tell
	end tell
	
	return s
end getValues


--creating a new document assigned with the uncoated profile prevents the InDesign "sticky" conversion problem
on getUncoatedValues(theColor, ucdoc)
	tell application id "com.adobe.indesign"
		set active document to ucdoc
		tell ucdoc
			set ns to make color with properties {model:model of theColor, space:LAB, color value:color value of theColor, name:name of theColor}
			set model of ns to process
			set space of ns to CMYK
			set cmykval to color value of ns
			set uncoatedCMYK to my getValueString(cmykval)
		end tell
	end tell
	
end getUncoatedValues

--check gamut by converting from Lab to document CMYK and back to Lab
--if the total value difference is greater than 5 call out-of-gamut
on gamutCheck(c, sdoc)
	set b to "Color is in CMYK Gamut: Yes"
	tell application id "com.adobe.indesign"
		tell sdoc
			set model of c to process
			set labval1 to color value of c
			set space of c to CMYK
			set space of c to LAB
			set labval2 to color value of c
			
			set diff to 0
			
			repeat with i from 1 to count of labval1
				set n1 to item i of labval1
				set n2 to item i of labval2
				
				set n to n1 - n2
				if n < 0 then set n to -n
				set diff to diff + n
			end repeat
			
			if diff is greater than 5 then
				set b to "Color is in CMYK Gamut: No"
			end if
			
			set color value of c to labval1
		end tell
	end tell
	return b & return
end gamutCheck


--get color values as a string with | separators
--val is the swatch color value
on getValueString(val)
	set s to ""
	repeat with x in val
		set s to s & (round x) & "|"
	end repeat
	set s to text 1 thru -2 of s
	return s & return
end getValueString


-----------------------RGB to HEX conversion-----------------------


--converts 3 RGB values to HEX and returns a string in #000000 format
--https://en.wikipedia.org/wiki/Hexadecimal#Other_simple_conversions

on convertRGB(r, g, b)
	set h1 to my toHex(r)
	if (count of characters in h1) is 1 then
		set h1 to "0" & h1
	end if
	
	set h2 to my toHex(g)
	if (count of characters in h2) is 1 then
		set h2 to "0" & h2
	end if
	
	set h3 to my toHex(b)
	if (count of characters in h3) is 1 then
		set h3 to "0" & h3
	end if
	
	return "#" & h1 & h2 & h3
end convertRGB

--converts a number between 0 and 255 to hex code
on toHex(d)
	set r to d mod 16
	if (d - r) is 0 then
		return my toChar(r)
	end if
	set hn to (my toHex((d - r) / 16)) & (my toChar(r))
	return hn
end toHex

on toChar(n)
	set alphaList to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}
	set pos to (n as number) + 1
	return item pos of alphaList
end toChar


 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 27, 2020 0
Adobe Community Professional ,
Sep 27, 2020

Copy link to clipboard

Copied

I just checked the script and it’s not working with CC2020. I’ll post an updated version in a bit.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 27, 2020 0
Adobe Community Professional ,
Sep 28, 2020

Copy link to clipboard

Copied

There was a minor problem that I fixed in the linked script—it should be working in 2020, but I have not tested with Catalina. I also ran the chart using ISO Coated and uncoated, the ID document and PDF are in a new folder named ISO Coated Charts.

 

The script expects an open front document containing the Lab defined Pantone swatches you want to get conversions for.

 

Same address:

https://adobe.ly/39gljX4

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 28, 2020 0
Participant ,
Sep 28, 2020

Copy link to clipboard

Copied

Thanks rob, it's working now 🙂
Although it's pretty dead slow – around 70 pages/700 swatches took nearly 30 minutes?!
Guess it's a task to run over night with a liberary with over 2000 swatches...

And fyi – you mixed old and new profiles:
new: "PSO coated v3" & "PSO uncoated v3"
OR
old: "ISO coated v2" & "PSO uncoated ISO12647"

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 28, 2020 0
rob day LATEST
Adobe Community Professional ,
Sep 29, 2020

Copy link to clipboard

Copied

Yes, you’ll have to run it over night for 2000 swatches. Not sure why but it gets progressively slower, so splitting the swatches up and combining docs would be faster. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 29, 2020 0