On this Page

    Colors

    DocOrigin scripting defines a number of pre-defined color names that can be used on document objects. You can also specify colors using standard RGB notation.

    Setting Colors

    Colors may be set by either specifying the RGB value of the color or using one of the pre-defined color names from the table below. RGB values must be specified as a 6-digit hex code with an optional # character preceding it. As of version 3.0.002.07 colors may also be specified as a 3-digit hex code such as #3fe which will be expanded to #30f0e0. (This is compatible with standard browser syntax).

    When the color of a DocOrigin object is returned it will always be returned in the 6-digit format, with no leading # character.

     Address._color = "red";
     Item._color = "FF0000";   // equivalent of "red"
     Item2._color = "#FF0000"; // alternate notation
     a = Item2._color;         // returns "FF0000"

    Note that all color settings - whether pre-defined names or hex codes - must be defined as strings.

    Pre-defined Colors

    TransparentFFFFFFFF


    BeigeF5F5DC

    Black000000

    Blue0000FF

    BrownA52A2A

    CoralFF7F50

    Cyan00FFFF

    DarkGrayA9A9A9

    GreenYellowADFF2F

    Gray808080

    Green00FF00

    LightBlueADD8E6

    LightCyanE0FFFF

    LightGreen90EE90

    LightGrayD3D3D3

    LightPinkFFB6C1

    LightYellowFFFFE0

    MagentaFF00FF

    OrangeFFA500

    PinkFFC0CB

    RedFF0000

    SalmonFA8072

    Turquoise40E0D0

    YellowFFFF00

    WhiteFFFFFF

    To set the text background to transparent use:

    this._backgroundColor = "transparent";

    See Also

    DOM Properties