## com.lowagie.text.rtf.style
Class RtfColorList

    java.lang.Object
      com.lowagie.text.rtf.RtfElement
          com.lowagie.text.rtf.style.RtfColorList

All Implemented Interfaces:
  RtfBasicElement, RtfExtendedElement

    public class RtfColorList

extends RtfElement
implements RtfExtendedElement

The RtfColorList stores all colours that appear in the document. Black and White are always added

Version:
  $Version:$
Author:
  Mark Hall (mhall@edu.uni-klu.ac.at)

Field Summary
`private static byte[]` `COLOR_TABLE` Constant for the beginning of the colour table
`(package private) java.util.ArrayList` `colorList` ArrayList containing all colours of this RtfColorList

Fields inherited from class com.lowagie.text.rtf.RtfElement
`document, inHeader, inTable`

Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement
`CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR`

Constructor Summary
`RtfColorList(RtfDocument doc)` Constructs a new RtfColorList for the RtfDocument.

Method Summary
`int` `getColorNumber(RtfColor color)` Returns the index of the given RtfColor in the colour list.
`byte[]` `writeDefinition()` Write the definition part of the colour list.

Methods inherited from class com.lowagie.text.rtf.RtfElement
`intToByteArray, isInTable, setInHeader, setInTable, setRtfDocument, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.lowagie.text.rtf.RtfBasicElement
`setInHeader, setInTable, setRtfDocument, write`

Field Detail

### COLOR_TABLE

    private static final byte[] COLOR_TABLE

  Constant for the beginning of the colour table

### colorList

    java.util.ArrayList colorList

  ArrayList containing all colours of this RtfColorList

Constructor Detail

### RtfColorList

    public RtfColorList(RtfDocument doc)

  Constructs a new RtfColorList for the RtfDocument. Will add the default black and white colours.

  Parameters:
    `doc` - The RtfDocument this RtfColorList belongs to

Method Detail

### getColorNumber

    public int getColorNumber(RtfColor color)

  Returns the index of the given RtfColor in the colour list. If the RtfColor is not in the list of colours, then it is added.

  Parameters:
    `color` - The RtfColor for which to get the index
  Returns:
    The index of the RtfColor

### writeDefinition

    public byte[] writeDefinition()

  Write the definition part of the colour list. Calls the writeDefinition methods of the RtfColors in the colour list.

  Specified by:
    `writeDefinition` in interface `RtfExtendedElement`
  Returns:
    A byte array with the definition colour list