Color Profiles

Top Previous Topic Next Topic  Print this topic

This section describes the support for color profiles in XF Ultrascale 2012 .


Graphics professionals know the importance of color management. No matter how much thought you put into the color scheme for a given project, all of that work is for naught if you can't get your printed results to match your expectations.


Each color is encoded as a combination of Red, Green and Blue values. What do these values mean; e.g. what color is 88/249/17? Without any context, it is a meaningless triplet of numbers. This is where color spaces come in.


A color space provides the definition for what color the numerical combination represents.

If our example of 88/249/17 is interpreted using the Adobe RGB color space, it is a vibrant, attention getting green. If, on the other hand, the same value is interpreted using the sRGB color space, it is a pale, yellowish-green.


                       (88, 249, 17) in Adobe RGB The same RGB value in sRGB


RGB Colors

By default all colors used in your XSL-FO documents are considered to be given in the sRGB color space.


To use RGB colors, you can either specify values for the each component (Red, Green and Blue), or you can specify a color name. XF Ultrascale 2012 supports the extended palette described in the SVG specifications for both SVG and XSL-FO input.


The following notations are equivalent:



       <fo:block color="red">Red text.</fo:block>

       <fo:block color="rgb(255,0,0)">Red text.</fo:block>

       <fo:block color="rgb(100%,0%,0%)">Red text.</fo:block>

       <fo:block color="#FF0000">Red text.</fo:block>

       <fo:block color="#F00">Red text.</fo:block>



The last notation is called a short notation. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00.


When generating PDF, all RGB colors are mapped to a predefined PDF color space called DeviceRGB.


CMYK Colors

you can use an Ecrion specific extension to specify colors in CMYK (Cyan,Magenta,Yellow,Black) format:



       <fo:block color="cmyk(0%,100%,100%,0%)">Red text.</fo:block>

      <fo:block color="cmyk(0,1,1,0)">Red text.</fo:block>

      <fo:block color="cmyk(0,0.5,0.7,0)">Color text.</fo:block>



When generating PDF, all CMYK colors specified using this extension are mapped to DeviceCMYK color space.

If you have a CMYK color profile you wish to use, read below.


ICC Profiles

In addition, the XSL-FO recommendation specifies how to use colors described by an external ICC profile. With accurate monitor and printer profiles, your prints will closely

match what you see on your monitor.


To declare a color space use fo:color-profile:


<fo:root xmlns:fo="">


               <fo:color-profile color-profile-name="RGBColorProfile" src="ColorProfiles\RGB\AppleRGB.icc"/>

               <fo:color-profile color-profile-name="CMYKColorProfile" src="ColorProfiles\CMYK\USWebCoatedSWOP.icc"/> (1)



               <fo:simple-page-master master-name="all-pages" page-width="8in" page-height="11in">

                       <fo:region-body region-name="xsl-region-body" column-gap="0.25in" padding-top="6pt" padding-left="6pt"                                        padding-right="6pt" padding-bottom="6pt" margin-top="0.7in" margin-left="0.7in" margin-right="0.7in"                                                margin-bottom="0.7in"/>

                       <fo:region-before region-name="xsl-region-before" display-align="after" extent="0.7in"padding-top="6pt"                                        padding-left="0.7in" padding-right="0.7in" padding-bottom="6pt"/>

                       <fo:region-after region-name="xsl-region-after" display-align="before" extent="0.7in" padding-top="6pt"                                        padding-left="0.7in" padding-right="0.7in" padding-bottom="6pt"/>


               <fo:page-sequence-master master-name="default-sequence">

                       <fo:repeatable-page-master-reference master-reference="all-pages"/>



       <fo:page-sequence master-reference="default-sequence">

               <fo:flow flow-name="xsl-region-body" font-size="12pt" font-family="Times New Roman">

                       <fo:block background="rgb(255,0,0)">RGB Color</fo:block>

                       <fo:block background="rgb-icc(255,0,0,#RGBColorProfile, 1, 0, 0)">ICC RGB Color</fo:block> (2)

                       <fo:block background="rgb-icc(255,0,0,#CMYKColorProfile, 0, 1, 1, 0)">ICC CMYK Color</fo:block>

                       <fo:block background="rgb(0,255,0)">RGB Color</fo:block>

                       <fo:block background="rgb-icc(0,255,0,#RGBColorProfile, 0, 1, 0)">ICC RGB Color</fo:block>

                       <fo:block background="rgb-icc(0,255,0,#CMYKColorProfile, 0.63, 0, 1, 0)">ICC CMYK Color</fo:block>

                       <fo:block background="rgb(255,0,255)">RGB Color</fo:block>

                       <fo:block background="rgb-icc(255,0,255,#RGBColorProfile, 1, 0, 1)">ICC RGB Color</fo:block>

                       <fo:block background="rgb-icc(255,0,255,#CMYKColorProfile, 0.27, 0.82, 0, 0)">ICC CMYK Color</fo:block>





The important points in this example are:


(1) We declare two color spaces, named "RGBColorProfile" and "CMYKColorProfile".

(2) We use rgb-icc function to specify the intensities of each component in this color space. The name of this function is a little misleading, because rgb-icc can be used to describe not only RGB (Red, Green, Blue) colors, but also Grayscale, CMYK and spot (Pantone) colors.


rgb-icc takes the following arguments:



       rgb-icc(fallbackRed,fallbackGreen,fallbackBlue,#colorProfileReference, component1,..., componentN)



First three parameters are used when the color profile can not be found, or when the document is displayed in XF Designer.
The fourth parameter is a reference to a color profile declared with fo:color-profile.
The fifth and next parameters are used to specify the color.


If your color profile is a Grayscale color profile, you will use only component1. If you have a RGB color profile, you must use three values, while for a CMYK color profile you must use four values. Each value is a floating point number and must be between 0.00 and 1.00 and represents the intensity of that color.


For a CMYK color profile you have to specify all four components.



XF Ultrascale 2012 will output an error if the number of components you specify when using rgb-icc does not match the number of colors defined in the color profile.