This script displays the real and logical colours on a canvas together with their integer values.
Alongside each logical colour, the current real colour mapping is shown.
If you don’t want to run the DXL yourself, then just click on the image to the right to view the full size screenshot.
// Test Real Colours /* Prints Real and Logical Colours on a canvas. Tony Goodman */ DB dbMain = null DBE dbeCanvas = null void doDrawCanvas(DBE cnv) { int rColour = 0 int lColour = 0 string rName = "" string lName = "" int x = 0 int y = 0 int h = 0 realBackground(cnv, realColor_White) // real colours x = 50 y = 50 realColor(cnv, realColor_Black) font(cnv, 1, HeadingsFont) draw(cnv, x, y, "Real Colours") y = y + height(cnv, "X") + 20 font(cnv, 3, TextFont) h = height(cnv, "X") for (rColour = 0; rColour <= 36; rColour++) { realColor(cnv, rColour) //draw(cnv, x + 100, y, rName) rectangle(cnv, x, y - h, 50, h) realColor(cnv, realColor_Black) draw(cnv, x + 60, y - 3, "" rColour ". " getRealColourName(rColour)) y += (h + 5) } // logical colours x = 250 y = 50 realColor(cnv, realColor_Black) font(cnv, 1, HeadingsFont) draw(cnv, x, 50, "Logical Colours [Real colour mapping]") y = y + height(cnv, "X") + 20 font(cnv, 3, TextFont) h = height(cnv, "X") for (lColour = 0; lColour < 64; lColour++) { rColour = getRealColour(lColour) if (rColour < 0 || rColour > 36) { //print("Illegal realColour for [" lColour "] " getLogicalColourName(lColour) "\n") continue } realColor(cnv, rColour) //draw(cnv, x + 100, y, rName) rectangle(cnv, x, y - h, 50, h) realColor(cnv, realColor_Black) draw(cnv, x + 60, y - 3, "" lColour ". " getLogicalColourName(lColour) " [" getRealColourName(rColour) "]") if (lColour == 30) { y = height(cnv, "X") + 70 x = 600 } else { y += (h + 5) } } } dbMain = create("Real Colours") dbeCanvas = canvas(dbMain, 900, 810, doDrawCanvas) realize dbMain doDrawCanvas(dbeCanvas) show dbMain