Task

Display a word in various colours on the terminal.

The system palette, or colours such as Red, Green, Blue, Magenta, Cyan, and Yellow can be used.



Optionally demonstrate:

 How the system should determine if the terminal supports colour
 Setting of the background colour
 How to cause blinking or flashing (if supported by the terminal)


--
-- demo\rosetta\Coloured_text.exw
-- ==============================
--
with javascript_semantics
text_color(GRAY)
bk_color(BLACK)
printf(1,"Background color#     00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n")
printf(1,"                      -----------------------------------------------\n")
for foreground=0 to 15 do
    printf(1,"Foreground color# %02d  ",foreground)
    for background=0 to 15 do
        text_color(foreground)
        bk_color(background)
        printf(1,"%02d",foreground)
        text_color(GRAY)
        bk_color(BLACK)
        printf(1," ")
    end for
    printf(1,"\n")
end for
printf(1,"\n\npress enter to exit")
{} = wait_key()
