Skip to main content
Skip table of contents

(v13) HqnColorDatabase procset


This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP.

In practice, the TintTransform and Lookup procedures can get complex, and they have an amount of boiler plate code that can be shared amongst numerous NCDs. Therefore, NCDs are often conveniently created in the context of this helper procset, with the aim of simplifying the construction of named color resources. It is used with almost all of the shipping NCDs. The simplifications include:

  • the automatic generation of Lookup and TintTransform procedures
  • the color values can be straightforwardly placed into the NCD from a csv file
  • commonly required colorant name matching patterns can be automatically applied, for example; Pantone (TM) colors come in many subtle variants such as CV, CVU, CVC, and others. Another common variation is the case of colorant names, which vary with the application. Name variants can be mapped onto the same value from the Colors dictionary.

These simplified resources normally contain a small control dictionary followed by a list of colorant names and their equivalent solid color values, each on a single line. These are continuously read until the end of the file. This imposes the restrictions that these resources should be in their own files; and there should be no empty lines between the control dictionary and the end of the file.

This is an example of an NCD using the HqnColorDatabase procset, which happens to contain a subset of the IllustratorColors NCD that is shipped with the RIP:


CODE
<<
	/Globalness currentglobal
	false setglobal			 	% Will be reverted by initialize
	/ResName /IllustratorSubset % The name of this resource
	/BaseSpace /DeviceCMYK 		% Underlying color space for the colors
	/Divisor 1 					% Take values as-is, without dividing
	/ForceUpperCase false 		% Allow lower case in color names
>> /HqnColorDatabase /ProcSet findresource /initialize get exec Forest Green
1 0.55 1 0
Gold
0.05 0.2 0.95 0
Grass Green 0.75 0.05 1 0
Orange
0 0.45 1 0

Alternatively, the colorant names and color values may be included within the body of the dictionary using the Colors entry. This model is more appropriate when including NCDs in-line in a configuration stream.

These are the controls available:

ResName

(Required; as from Harlequin 12.1r1, the value may be a name or a string) the name of the NamedColor resource to be created.

BaseSpace

(Required, name) the color space that the values following the call are defined in: /DeviceCMYK, /DeviceRGB, /DeviceGray, /DeviceN, and /XYZ-D50 are supported. The Separation space is not in this list, they should use a single component /DeviceN space. Note that any one NamedColor resource based on HqnColorDatabase can only use one color space (/BaseSpace) for the colors it defines.

Colorants

(Required if BaseSpace is /DeviceN, ignored otherwise, array of names) The array of colorant names to be used in the color space.

MissingColorant

(Optional, name, default: /Ignore). Only relevant if the BaseSpace is /DeviceN, ignored otherwise. Controls what should be done if the Colorants array includes a name that is not already configured to be rendered (as detected using currentseparationorder):

/Ignore - ignore this database and try the next one

/Add - add the colorant to the list to be rendered

/Error - trigger a configurationerror

/PassThrough - ignore the fact that a colorant is missing and assume some other code deals with it (for example, a second call to name color lookup).

Colors

(Optional, Dictionary) If supplied this must be a dictionary in which the keys are the named color names that are to be replaced. Each value must be an array of numbers representing the component colors of the replacement color; the number and range of the numbers must be appropriate for the BaseColor selected (and the Colorants array if BaseColor is /DeviceN). Adding the Colors dictionary means that the NamedColor resource may be included in-line in configuration code more easily. If the supplied dictionary includes a /Colors dictionary there should be no color data following the call to initialize.

Divisor

(Required in 11 and earlier; optional in v12, number, default: 1) all color values in the following lines are divided by this value as they are read. If color values are provided in the Colors dictionary, instead of in the lines following the call to initialize, the Divisor is not applied.

Globalness

(Optional, Boolean, default: currentglobal) The global state should be returned to this state after installing the NamedColor resource.

ForceUpperCase

(Optional, Boolean, default: true) If true, all names are converted to uppercase before matching one in the database all names in the database are expected to be uppercase if so. If false, mixed or lower-case names are allowed in the database. Only ASCII characters are converted.

ExtendedNameMatch

(Optional, Boolean, default: false) If true, if an exact match for a name (upper-cased if ForceUpperCase is true) is not found in the database, then further attempts are made to find the name by interpreting it as UTF-8 and in each of the encodings provided by HqnLocal's /GetJobEncodings procedure. If ForceUpperCase is true, then this additional matching is case-insensitive. This option allows, for example, a PDFDoc-encoded color name in the job to be matched against its UTF-8-encoded equivalent in the database.

Names in the database must be encoded as UTF-8 for this extended matching functionality to be useful.

RetrySuffix

(Optional, Boolean, default: false) Only relevant if the BaseSpace is /XYZ-D50, ignored otherwise. If true, a colorant name ending ”CVC” for which no entry is supplied is retried without the trailing ’C’.

PantoneSuffix

(Optional, string, default: null) If not null, all colorant names supplied to the Lookup procedure that end with ’CVC’, ’CVU’, ’CVP’ or ’CV’ have that ending replaced with the value of PantoneSuffix before checking in the database (the unaltered name is NOT searched for first).

AllowColorManagement

(Optional, Boolean, default: true) Sets the corresponding key in the NCD, see (v13) Named color database resources.

RelativeWhitePoint

(Optional, array of three numbers, No default) Only relevant if the BaseSpace is /XYZ-D50. It provides the XYZ of the media white on which the spots are printed. It results in better appearance for tints and light spots when using a relative rendering intent. This value is used to augment the base XYZ-D50 color space with a RelativeWhitePoint value; see (v13) Other CIEBased color spaces.

Example use:

CODE
%IPS
<<
/ResName /SilverReplacement % The name of this resource
/BaseSpace /DeviceN % Underlying color space for the values below
/Colorants [ /Cyan2 /Magenta2 /Yellow2 /Black2 /Silver ]
/MissingColorant /Error
/ForceUpperCase false
/Divisor 1
/Colors <<
	/SilverMetalicColor [ .26 .26 .26 .07 1 ]
	>>
>> /HqnColorDatabase /ProcSet findresource /initialize get exec


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.