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
andTintTransform
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:
<<
/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:
| (Required; as from Harlequin 12.1r1, the value may be a name or a string) the name of the |
| (Required, name) the color space that the values following the call are defined in: |
| (Required if |
| (Optional, name, default:
|
| (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 |
| (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. |
| (Optional, Boolean, default: |
| (Optional, Boolean, default: |
| (Optional, Boolean, default: Names in the database must be encoded as UTF-8 for this extended matching functionality to be useful. |
| (Optional, Boolean, default: |
| (Optional, string, default: |
| (Optional, Boolean, default: |
| (Optional, array of three numbers, No default) Only relevant if the |
Example use:
%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