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)


fcn table(title,mode){
   println("\n\e[1m%s\e[m\n bg\t fg".fmt(title));
   foreach b in ([40..48].chain([100..107])){
      print("%3d\t\e[%s%dm".fmt(b,mode,b));
      foreach f in ([30..38].chain([90..97])){ print("\e[%dm%3d ".fmt(f,f)) }
      println("\e[m");
   }
}
 
table("normal ( ESC[22m or ESC[m )", 		"22;");
table("bold ( ESC[1m )",			"1;");
table("faint ( ESC[2m ), not well supported",	"2;");
table("italic ( ESC[3m ), not well supported",	"3;");
table("underline ( ESC[4m ), support varies",	"4;");
table("blink ( ESC[5m )",			"5;");
table("inverted ( ESC[7m )",			"7;");