term_colour
Previous Topic  Next Topic 

Synopsis:

        term_colour(foreground,background)

or

        term_colour(user_defined_colour)


Arguments:

               Foreground                - The foreground colour (0..15)

       background        - the background colout (0..15)


or


       user_defined_atrribute - One of the 256 colour attributes that can be defined by the user using term_attr_def()


Description:   This function sets the current foreground and background colours used by the task in subsequent calls to terminal output functions (such as term_print(), term_write, applog() etc).           


The function can take one of two forms,  the first of which specifies the foreground and background colours from the predefined set of colours shown below (foreground and backTaken from the Colour code column):


Colour Name

Colour Code

Black

0

Blue

1

Green

2

Cyan

3

Red

4

Purple

5

Brown

6

White

7

Grey

8

Bright Blue

9

Bright Green

10

Bright Blue

11

Bright Red

12

Bright Purple

13

Bright Yellow

14

Bright White

15



The second form of the function takes one of the 256 user defined colour attribute that can be defined by the term_attr_def() function.     A colour attribute is a number between 0 and 255 and which indexes a table that provides both the foreground and background colour for that attribute.        Typically this form of the function is used to allow colour combinations outside of the predefined colours defined in the above table.


Return Value:   Returns 0 or a negative error value (e.g if an invalid colour is given).