Colour class

The Colour class gives access to colours in Reporter. More...

The REPORTER JavaScript API provides many class constants, properties and methods. For Arup to be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:

Class functions

Colour properties

Name Type Description
blue (read only) integer Colour blue component (0-255)
green (read only) integer Colour green component (0-255)
name (read only) string Colour name
red (read only) integer Colour red component (0-255)

Detailed Description

The Colour class is used to define colours, either by predefined colours or by RGB values. The easiest way to set the colour of something is to use the predefined colour methods. e.g. to set the text colour of item i to red:

i.textColour = Colour.Red();

For other colours use Colour.RGB().

Details of functions

Black() [static]

Description

Creates a black colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to black:

i.textColour = Colour.Black();


Blue() [static]

Description

Creates a blue colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to blue:

i.textColour = Colour.Blue();


Cyan() [static]

Description

Creates a cyan colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to cyan:

i.textColour = Colour.Cyan();


Green() [static]

Description

Creates a green colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to green:

i.textColour = Colour.Green();


Grey10() [static]

Description

Creates a 10% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 10% grey:

i.textColour = Colour.Grey10();


Grey20() [static]

Description

Creates a 20% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 10% grey:

i.textColour = Colour.Grey20();


Grey30() [static]

Description

Creates a 30% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 30% grey:

i.textColour = Colour.Grey30();


Grey40() [static]

Description

Creates a 40% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 40% grey:

i.textColour = Colour.Grey40();


Grey50() [static]

Description

Creates a 50% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 50% grey:

i.textColour = Colour.Grey50();


Grey60() [static]

Description

Creates a 60% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 60% grey:

i.textColour = Colour.Grey60();


Grey70() [static]

Description

Creates a 70% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 70% grey:

i.textColour = Colour.Grey70();


Grey80() [static]

Description

Creates a 80% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 80% grey:

i.textColour = Colour.Grey80();


Grey90() [static]

Description

Creates a 90% grey colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to 90% grey:

i.textColour = Colour.Grey90();


Magenta() [static]

Description

Creates a magenta colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the text colour of item i to magenta:

i.textColour = Colour.Magenta();


None() [static]

Description

No colour

Arguments

No arguments

Returns

Colour object

Return type

Colour

Example

To set the fill colour of item i to no colour:

i.fillColour = Colour.None();


RGB(red[integer], green[integer], blue[integer]) [static]

Description

Creates a colour from red, green and blue components

Arguments

  • red (integer)

    red component of colour (0-255).

  • green (integer)

    green component of colour (0-255).

  • blue (integer)

    blue component of colour (0-255).

    Returns

    Colour object

    Return type

    Colour

    Example

    To set the text colour of item i to red:

    i.textColour = Colour.RGB(255, 0, 0);


    Red() [static]

    Description

    Creates a red colour

    Arguments

    No arguments

    Returns

    Colour object

    Return type

    Colour

    Example

    To set the text colour of item i to red:

    i.textColour = Colour.Red();


    White() [static]

    Description

    Creates a white colour

    Arguments

    No arguments

    Returns

    Colour object

    Return type

    Colour

    Example

    To set the text colour of item i to white:

    i.textColour = Colour.White();


    Yellow() [static]

    Description

    Creates a yellow colour

    Arguments

    No arguments

    Returns

    Colour object

    Return type

    Colour

    Example

    To set the text colour of item i to yellow:

    i.textColour = Colour.Yellow();