FONT_COLOR

FONT_COLOR N,R,G,B

SET THE COLOR OF CHARACTERS DISPLAYED BY THE SYSTEM OBJECT NUMBER N

  • Type: Command
  • Parameters: 4
  • Group: Font

ACTION

The command FONT_COLOR N,R,G,B set the color of the characters displayed by the system object number N.

The system object is of type : BUTTON, EDIT, MEMO, COMBO, ALPHA, FORM, LIST, PICTURE, CHECK, OPTION, SPIN, GRID, CONTAINER, MEMO_RICH, BUTTON_PICTURE, SCENE2D, PANEL, GRID_DRAW, CONTAINER_OPTION, TAB, SYNEDIT, CHART.

This command is not active on a BUTTON.

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

SYNTAX: FONT_COLOR N,R,G,B

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.
  • 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 FONT_COLOR is used to set the color of the text displayed by a system object.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than 0.
  • If the system object number N does not exist.
  • If number N is not a system object of the type : BUTTON, EDIT, MEMO, COMBO, ALPHA, FORM, LIST, PICTURE, CHECK, OPTION, SPIN, GRID, CONTAINER, MEMO_RICH, BUTTON_PICTURE, SCENE2D, PANEL, GRID_DRAW, CONTAINER_OPTION, TAB, SYNEDIT, CHART.
  • 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 create a MEMO

memo 1

rem fill it with a line

item_add 1,"Hello !"

rem color the line in red

font_color 1,255,0,0

SEE ALSO

FONT_NAME

FONT_SIZE

FONT_BOLD

FONT_BOLD_OFF

FONT_ITALIC

FONT_ITALIC_OFF

FONT_UNDERLINE

FONT_UNDERLINE_OFF

FONT_STRIKE

FONT_STRIKE_OFF