# Elementname: `DefineColor`

## Description

Colors defined with DefineColors can be referenced later by their name.

Allowed attributes: b, c, colorname, g, k, m, model, name, overprint, r, value, y

Child elements: (none)

Parent elements: AtPageCreation, AtPageShipout, Case, Contents, ForAll, Include, Layout, Loop, Otherwise, Record, SavePages, Until, While

### Attributes

b (0 up to 100, optional)

  Blue part with RGB

c (0 up to 100, optional)

  Cyan part with CMYK

colorname (text, optional)

  The name of the spot color if model is »spotcolor«. The name must match the required color name, such as »PANTONE 116 C«.

g (0 up to 100, optional)

  Green part with RGB / gray part when using the model gray

k (0 up to 100, optional)

  Black part with CMYK

m (0 up to 100, optional)

  Magenta part with CMYK

model (optional)

  Color model to be used for the color. Currently “rgb”, “cmyk”, “gray” and “spotcolor” are supported.

  cmyk: | CMYK (cyan, magenta, yellow, key/black)
  rgb: | RGB (red, green, blue)
  gray: | Gray (0=Black)
  spotcolor: | Use a PANTONE or HKS color.

name (text)

  The name of the color to be defined.

overprint (optional)

  Enable overprint for this color.

  yes: | Enable overprint for this color.
  no: | Disable overprint for this color (default).

r (0 up to 100, optional)

  Red part with RGB

value (text, optional)

  Hex value of the color, such as #FA5 or #FFAA55.

y (0 up to 100, optional)

  Yellow part with CMYK

## Example

    <DefineColor name="black" model="cmyk" c="0" m="0" y="0" k="100"/>
    <DefineColor name="white" model="rgb" r="100" g="100" b="100"/>

## Info

The CSS level 3 colors are predefined in RGB-space. See http://www.w3.org/TR/css3-color/ for the definitions. That means you can use common colors such as `red` or `goldenrod` without using DefineColor.

The predefined colors are: "black","aliceblue", "orange", "rebeccapurple", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", and "yellowgreen".

# Commands

- A
- Action
- AddToList
- AtPageCreation
- AtPageShipout
- Attribute
- B
- Barcode
- Bold
- BoldItalic
- Bookmark
- Box
- Br
- Case
- Circle
- Color
- Column
- Columns
- Contents
- Copy-of
- DefineColor
- DefineFontfamily
- DefineTextformat
- Element
- EmptyLine
- Fontface
- ForAll
- Frame
- Grid
- Group
- HSpace
- Hyphenation
- I
- Image
- Include
- InsertPages
- Italic
- Layout
- Li
- LoadDataset
- LoadFontfile
- Loop
- Makeindex
- Margin
- Mark
- Message
- NewPage
- NextFrame
- NextRow
- NoBreak
- Ol
- Options
- Otherwise
- Output
- Overlay
- PDFOptions
- Pageformat
- Pagetype
- Paragraph
- PlaceObject
- Position
- PositioningArea
- PositioningFrame
- ProcessNode
- Record
- Regular
- Rule
- SaveDataset
- SavePages
- Sequence
- SetGrid
- SetVariable
- SortSequence
- Stylesheet
- Sub
- Sup
- Switch
- Table
- Tablefoot
- Tablehead
- Tablerule
- Td
- Text
- Textblock
- Tr
- Transformation
- U
- URL
- Ul
- Until
- VSpace
- Value
- While

Version: 2.6.1 | Start page | Command reference | Other language: German