Skip to content

Tag Definition: color

Generated by rlextra version 4.3.0a1

Attributes

Name

Required?

Default_Value

Values

CMYK

implied

None

RGB

implied

None

alias

implied

None

density

implied

None

id

required

None

spotName

implied

None

Can contain
EMPTY

Purpose

To declare colors more precisely for use in various places in the document.

In most places that use colors by name or id you can also just specify a hex code.

A list of pre-defined colors can be found here.

See more about printing here

Example usage

They can be defined within or

<docinit>
    <color id="my-favourite-colour3" CMYK="(.52,.12,0,.45)" spotName="PANTONE 288 CV"/>
</docinit>
<template>
    <pageTemplate id="Page" pageSize="(595, 842)">
        <pageGraphics>
            <fill color="my-favourite-colour1"/>
            <rect x="100" y="150" width="100" height="300" fill="1"/>
            <fill color="my-favourite-colour2"/>
            <rect x="400" y="150" width="100" height="300" fill="1"/>
            <fill color="my-favourite-colour3"/>
            <rect x="250" y="150" width="100" height="300" fill="1"/>
        </pageGraphics>
        <frame id="Frame 1" x1="30" y1="30" width="535" height="782" showBoundary="1"/>
    </pageTemplate>
</template>
<stylesheet>
    <initialize>
        <color id="my-favourite-colour1" CMYK="(.52,.12,0,.45)" density="1"/>
        <color id="my-favourite-colour2" RGB="(.262745098,.478431373,.545098039)" density="1"/>
    </initialize>
</stylesheet>
...

Note: Only relevant sections are used in this snippet. Some tags were not included. See some of our samples for further insight of how you may go about setting up a full document using rml.

Example of nesting path from the parent tags to the current tag

<document> ➔ <docinit> ➔ <color>

<document> ➔ <stylesheet> ➔ <initialize> ➔ <color>