2D_PEN_COLOR

2D_PEN_COLOR R,G,B

SET THE DRAWING COLOR (PEN)

  • Type: Command
  • Parameters: 3
  • Group: Drawing

ACTION

The command 2D_PEN_COLOR R,G,B set the drawing color of the further drawings with the color resulting of the addition of the 3 specified primary components: red (R), green (G) and blue (B).

The intensity of each primary component can vary from 0 to 255. (0 = no color, 255 = full intensity)

Remark: when all the 3 primary components are 0, the result color is black (no color), when all the 3 primary components are 255, the result color is white (addition of the 3 primary colors at maximum intensity).

Recall:

- yellow color (red + green) when B = 0

- gray color when R=G=B

- violet color (red + blue) when G = 0

- black color when R=0, G=0, B=0

- white color when R=255, G=255, B=255

By default, the filling color is the black color (R=0, G=0, B=0).

SYNTAX: 2D_PEN_COLOR R,G,B

  • R = Red component value (integer or real) of the result color.
  • G = Green component value (integer or real) of the result color.
  • B = Blue component value (integer or real) of the result color.

USE

  • The command 2D_PEN_COLOR is used to set the color of the 2D drawings.

ERROR

  • If R or G or B is less than 0 or greater than 255.
  • If R or G or B is not a correct expression.

EXAMPLE

rem set the pen color to red

2d_pen_color 255,0,0

rem draw a circle with a red line

2d_circle 100,100,50

SEE ALSO

2D_ARC

2D_CIRCLE

2D_RECTANGLE

2D_ELLIPSE

2D_LINE

2D_POLY_FROM

2D_POLY_TO

2D_POINT

2D_PEN_DASH

2D_PEN_DASH_DOT

2D_PEN_DASH_DOT_DOT

2D_PEN_DOT

2D_PEN_SOLID

2D_PEN_WIDTH