Object Inquiry Built-in Functions
Return the foreground/background colors of a column and line position.
{foreground|background} at [column] COL_NO
[ line] line_NO char of TR_NAME
column COL_NO
An integer value representing a column in the textual region.
line line_NO
An integer value representing a line in the textual region.
char of TR_NAME
The identifier for a textual region.
Description
The foreground at and background at built-in functions each return an integer value associated with the color of the foreground or background of the character at the specified line and column.
These built-in functions ignore emphasis, since the emphasize action statement affects only the appearance of the text, and not the internally-stored color attribute.
When you use these functions with colored textual regions, the values returned represent the colors of the individual characters in the colored textual region. If you use these functions with uncolored textual regions, the values returned are the same as the foreground of and background of functions, representing the colors specified in the textual region definition.
Example
# If the text at the position selected does not
# have a red (color 1) background, then make it red.
response to TR_7
if (background at column xcoord line ycoord
char of TR_7 != 1) then
make TR_7 column xcoord line ycoord background red
end if
# If the text at the position selected does not have
# a blue (color 4) foreground, then make it blue.
response to TR_8
if (foreground at column xcoord line ycoord
char of TR_8 != 4) then
make TR_8 column xcoord line ycoord foreground blue
end if
See Also
background of Object Inquiry Built-in Function
color Keyword
foreground of Object Inquiry Built-in Function