The Colour class contains constants relating to colours. More...
The PRIMER 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:
p.colour = Colour.RED;
For other colours use Colour.RGB().
Details of functionsGetFromName(name[string]) [static]DescriptionReturns the colour for a given core or user colour name |
The name of the colour, for example red or user_green or green/cyan.
Returnscolour value (integer) Return typeNumber |
RGB(red[integer], green[integer], blue[integer]) [static]DescriptionCreates a colour from red, green and blue components |
red component of colour (0-255).
green component of colour (0-255).
blue component of colour (0-255).
Returnscolour value (integer) Return typeNumber |
ExampleTo set the colour of model m to red: m.SetColour( Colour.RGB(255, 0, 0) ); To set the colour of part p to red: p.colour = Colour.RGB(255, 0, 0);
|