Sets field colors.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL


void field_color([ALL,]rgb[,[name|number] | [attribute,flag]]])
expr             rgb
string           name
int              number, attribute, flag
keyword          ALL


ALL (optional) specifies that the color applies to all rows (for multi-record layouts). Otherwise only the current row is affected.

rgb is the RGB sequence for all fields in the current window.

name specifies the name of an individual field to which changes are applied.

number must evaluate to a valid field sequence number and specifies the field (by number) to which changes are applied.

attribute specifies that all fields with specified attribute have their colors set.

flag together with attribute specifies action to fields with the specified attribute.


The RGB sequence must be in hexadecimal format. The RGB sequence is either 8 bytes (background color only) or 16 bytes (both back and foreground colors). Each 8-byte sequence must be in a RRGGBBOO format where:
RR --- RED portion. Range 00 - FF.
GG --- GREEN portion. Range 00 - FF.
BB --- BLUE portion. Range 00 - FF.
OO --- is the option. Where option is:
  • 00 do not set (RRGGBB ignored).
  • 01 reset to default colors (RRGGBB ignored).
  • 02 set the colors.
  • 08 set to transparent (background only).
If the option portion of the RGB sequence is 00 or 01 then the RRGGBB portion can be set to any values.


Sets all rows fields' background color to red.
Sets all fields' background color to yellow and the foreground (text) color to blue for the current record (row).
Resets all fields' background color to the default values.
Resets all rows fields' foreground (text) color to black.