2D_FILL_COLOR

2D_FILL_COLOR R,G,B

SET THE FILLING COLOR OF SHAPES 2D_CIRCLE AND 2D_RECTANGLE

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

ACTION

The command 2D_FILL_COLOR R,G,B set the filling color of the further shapes to be drawn (CIRCLE, RECTANGLE) 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 background color.

SYNTAX: 2D_FILL_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_FILL_COLOR is used to set the filling color of the next shapes 2D_CIRCLE and 2D_RECTANGLE.

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 filling color to red

2d_fill_color 255,0,0

rem draw a circle: it is filled with red color

2d_circle 100,100,50

SEE ALSO

2D_CIRCLE

2D_RECTANGLE

2D_ELLIPSE

2D_FILL_CROSS

2D_FILL_DIAGONAL_CROSS

2D_FILL_DIAGONAL_DOWN

2D_FILL_DIAGONAL_UP

2D_FILL_HORIZONTAL

2D_FILL_SOLID

2D_FILL_VERTICAL