You are here: Surpac Concepts > Macros > SCL > SCL Graphics Drawing > SclGraphicsSetColour
GEOVIA Surpac

SclGraphicsSetColour

Overview

Set the colour for various items of geometry in a node

Synopsis

SclGraphicsSetColour $colourSpec

Description

Set the colour of various types of geometry. SclGraphicsSetColour can be called multiple times within an open node. Each time new settings are made they are added to the current list of colour settings. Colour settings are inherited down the node tree unless a node has its own idea of what the colour for a type of geometry should be.

A single colour setting takes the form of 'name=value'. Where name is the type of geometry to which the colour setting to is to be applied and value is the colour value to set.

Arguments

  • colourSpec
  • Pass by value.

    SclGraphicsSetColour is the general-purpose "draw with this colour please". You can just name a colour, or you can go into detail and also name the particular kind of geometry the colour applies to.

    The colour portion of colour-spec is in the form of a description, such as "pinkish sunset-orange" or "pale gray" or "R=0.8 G=0 B=0.1".

    If you just name a colour in colour-spec, all the different kinds of geometry are given that colour (window and contrast colours are unaffected).

    If you want to be more specific, colour-spec can also be a character string that consists of the type of geometry to be coloured, an equals sign, and the colour to be used. For example: lines=red. Blanks can be inserted around the words. More than one specification can be made in a given colour-spec by embedding a comma as in the following example:

    SclGraphicsSetColour "lines = red, edges = green"

    and identical colours can be folded together

    SclGraphicsSetColour "lines=edges=green, faces=markers=blue"

    Permitted values for geometry in the colour specification are:

    • markers - markers
    • lines, polylines - Lines and polylines
    • faces - faces of polygons
    • edges - Edges of polygons
    • text - Any text
    • face contrast - Used when a contrasting colour is required for drawing patterned faces.

    Permitted colour names include:

    apricot, aquamarine, bittersweet, black, blue, blue green, blue grey, blue violet, brick red, brown, moose brown, burnt orange, burnt sienna, cadet blue, cerulean, copper, cornflower, cyan, dandelion, forest green, fuchsia, gold, goldenrod, green, green blue, green yellow, grey, gray, indian red, jungle green, lavender, lemon yellow, magenta, mahogany, maize, maroon, melon, midnight blue, midnite blue, mulberry, navy blue, olive green, orange, orange red, orange yellow, orchid, peach, periwinkle, pine green, pink, carnation pink, plum, purple, violet, raw sienna, raw umber, red, red orange, red violet, royal purple, salmon, sea green, sepia, silver, sky blue, spring green, strawberry, wild strawberry, tangerine, vivid tangerine, teal, teal blue, thistle, turquoise blue, violet blue, violet red, white, yellow, yellow green, yellow orange

    Colours may be combined using ish and er or light and dark qualifiers like yellowish green, greener blue, light green, lighter green, dark blue, darker blue.

    Colours may also be defined using an RGB specification of the form:

    SclGraphicsSetColour "lines = R=1 G=0 B=.5, edges = R=0 G=1 B=0"

    The red, green and blue components must be in the range of 0.0 to 1.0 inclusive.

Returns

Nothing

Examples

SclGraphicsOpen mynode
  SclGraphicsSetColour "lines=red"
  SclGraphicsSetColour "lines=R=1 G=0 B=0"
  SclGraphicsSetColour "markers=red"
  SclGraphicsSetColour "text=green"
  SclGraphicsSetColour "text=R=0 G=1 B=0"
  SclGraphicsSetColour "faces=orange"
  SclGraphicsSetColour "face contrast=pink"
  SclGraphicsSetColour "lines,markers=red,text=green,faces=orange, face contrast=pink"
SclGraphicsClose