1
2Array colortab -->
3  "" "" "Black" "Red" "Green" "Yellow" "Blue" "Magenta" "Cyan" "White";
4
5[ TestColor val fg bg claim;
6
7  val = $0->1;
8
9  if (val & 1) {
10    print "Interpreter claims that colored text IS available.^";
11    claim = 1;
12  }
13  else {
14    print "Interpreter claims that colored text IS NOT available.^";
15    claim = 0;
16  }
17
18  if (claim)
19    print "^In the square below, you should see";
20  else
21    print "^If it was, in the square below, you would see";
22
23  print " vertical stripes of background color (matching the column
24    headers) and horizontal rows of foreground color (that is, all
25    # marks in a row the same color.)^";
26
27  font off;
28
29  new_line;
30  print "Bk Rd Gr Yl Bl Mg Cy Wh^";
31  for (fg=2:fg<10:fg++) {
32    for (bg=2:bg<10:bg++) {
33      @set_colour fg bg;
34      print "## ";
35    }
36    @set_colour 1 1;
37    print ": ", (string)colortab-->fg, "^";
38  }
39
40  font on;
41
42];
43