BORDER, PAPER, INK: let’s color our display!

Who comes from the ZX Spectrum world knows perfectly these commands that are his bread and butter. For QL there is not much difference except the lack of border area (thankfully) but the command purpose is only to draw a border, in the output window, having the thickness chosen by the user. Therefore the thickness is 0 by default. The syntax is the following:
BORDER thickness,color
This command draws a colored border in the display area. Therefore if you want to create a border in another area of the screen, you must use the WINDOW statement which, through the 4 parameters, “draws” a rectangle in the desired area of the screen. Hence the useful BORDER command will clearly mark the WINDOW output area on the screen. If you want you can create a “multicolored border” by simply making a thick colored border followed by other borders having decreasing thicknesses.
Example:


470 BORDER 7.2
480 BORDER 6.3
490 BORDER 5.4
500 BORDER 4.5
510 BORDER 3.6


This will create a border into another thus giving an appearance of depth. It must be said that the print commands will end up in the edge area overlapping the rectangle generated by the command. Therefore is recommended to type:
AT x, y: PRINT “text”
Paper works exactly as for the ZX Spectrum although its effect is achieved only after a CLS.
If the PRINT command follows the PAPER one, as in ZX Spectrum it will color the background of the printed text.
Finally INK defines the color for text or graphical drawings (on QL it can also be applied to points and lines).
As regards the color range, the QL is not limited as the ZX because in addition to the classic system colors (depending on if you are using a classic QL or an emulator or an expanded system), the colors will be mixed through the screen system in order to offer more color shades.

 

Photo: Dirty numbers   by Håkan Dahlström /  CC BY