System and user-defined Pens

System Pens

The thirteen named Pens in the Standard library (Black, Blank, Blue, Grey, etc) exist as named objects and are considered SystemPens.

System Pens are defined by JSON:

{"Pen":{"Colour":{"RGBA":[0,0,0,0]}}} for the Black Pen

{"Pen":{"Style":"Null","Colour":{"RGBA":[0,0,0,0]}}} for the Blank Pen

{"Pen":{"Colour":{"RGBA":[0,0,255,0]}}} for the Blue Pen

{"Pen":{"Colour":{"RGBA":[128,128,128,0]}}} for the Grey Pen

.

.

etc.

.

.

{"Pen":{"Colour":{"RGBA":[255,255,255,0]}}} for the White Pen

{"Pen":{"Colour":{"RGBA":[255,255,0,0]}}} for the Yellow Pen

The components of this code define the fact that the object is a Pen, the RGB values give it its RGB colour specification, the fourth parameter 'A' is a measure of transparency in the range 0 (zero) to 255, by default this value is 0 which defines the object as fully opaque, 255 defines fully transparent.

User-defined Pens

A User-defined pen is any pen which has a custom coding.

Changes to a standard system Pen code also results in a user-defined pen. These changes could be anything from a minor colour shade edit to an entirely new Pen with a number of levels (Multi-level Pen).

Note: User-defined pens do not exist as named objects. They are displayed according to their defining JSON. This code can be copied from the Edit Pen dialog > Clipboard > Copy as JSON option:

  • Use any text editor to examine or edit the code.
  • Copy it back into the Edit Pen dialog using Clipboard > Paste option.

In its simplest form a user-defined Pen may have the JSON:

{"Pen":{"Style":"Dash","Colour":{"RGBA":[0,0,255,0]}}}

Here the parameter "Dash" has been added so the Pen will produce a dashed blue LineString instead of a solid one.

TIP: See also User-defined Pens for more information.