Oasys.PRIMER.Colour class

Constants

Colour.ASSEMBLY

Base colour on assembly

Colour.BACKGROUND

Background colour

Colour.BLACK

Colour black

Colour.BLUE

Colour blue

Colour.CYAN

Colour cyan

Colour.DARK_ORANGE

Colour dark orange

Colour.DEFAULT

Default colour for objects

Colour.GREEN

Colour green

Colour.GREEN_CYAN

Colour green/cyan

Colour.GREY

Colour grey

Colour.INCLUDE

Base colour on include file

Colour.LIGHT_BLUE

Colour light blue

Colour.MAGENTA

Colour magenta

Colour.MATERIAL

For elements with part IDs base colour on material ID

Colour.MEDIUM_BLUE

Colour medium blue

Colour.MODEL

Base colour on model

Colour.NOT_BACKGROUND

Not the background colour

Colour.ORANGE

Colour orange

Colour.PART

For elements with part IDs base colour on part ID

Colour.RED

Colour red

Colour.RED_MAGENTA

Colour red/magenta

Colour.SECTION

For elements with part IDs base colour on section ID

Colour.SKETCH

Sketch colour

Colour.TEXT

Text colour

Colour.WHITE

Colour white

Colour.YELLOW

Colour yellow

Colour.YELLOW_GREEN

Colour yellow/green

Static methods

classmethod Colour.GetFromName(name)

Returns the colour for a given core or user colour name

Parameters:

name (string) – The name of the colour, for example red or user_green or green/cyan

Returns:

colour value (integer)

Return type:

int

classmethod Colour.RGB(red, green, blue)

Creates a colour from red, green and blue components

Parameters:
  • 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 value (integer)

Return type:

int

Example

To set the colour of model m to red:

m.SetColour( Colour.RGB(255, 0, 0) )

To set the colour of part p to red:

colour = Oasys.PRIMER.Colour.RGB(255, 0, 0)