Generator > Programming > Colors

Colors are handled by a Color base class. Colors can be of the following types:

These colors can be used with many of the Page Element objects. RGB and Web colors can be used with the Outline and Bookmark Objects.

Examples for creating color objects:

[Java]
    CmykColor cmykColor = new CmykColor(0.5f, 0.3f, 0.6f, 0.0f);
    RgbColor rgbColor = new RgbColor(0.5f, 0.3f, 0.6f);
    WebColor webColor1 = new WebColor("#FF0080");
    WebColor webColor2 = new WebColor("aqua");
    Grayscale grayscale = new Grayscale(0.3f);
    

Predefined Colors

The color class includes over 140 predefined colors accessed through static property of the Color class by color name. These names correspond with the colors commonly used in web development. These can also be specified by name in the constructor of the WebColor class or from within an HtmlTextArea.


See Also

CmykColor Class | Color Class | Grayscale Class | RgbColor Class | WebColor Class | DynamicPDF GeneratorJava: Getting Started