SmallBASIC’s graphics commands use integers (2D algebra commands use reals).
- Monochrome 0 = black, 15 = white
- 2bit (4 colors) 0 = black, 15 = white, 1-6, 8 = dark-gray, 7, 9-14 = light-gray
- 4bit (16 colors) 16 Standard VGA colors, 16 colors of gray (on PalmOS)
- 8bit (256 paletted colors) 16 Standard VGA colors. The remaining colors are ignored.
- 15bit (32K colors), 16bit (64K colors) and 24bit (1.7M colors) Color 0..15 is the standard VGA colors, full 24-bit RGB colors can be passed by using negative number.
Any point can be specified by an array of 2 elements or by 2 parameters
LINE x1, y1, x2, y2 or LINE [x1, y1], [x2, y2]
Polylines also work the same way.
DIM poly(10) ... poly = [x, y]
STEP keyword calculates x1, y1 parameters relative to the current
position. This applies to the following commands: RECT, PSET, LINE, CIRCLE, ARC, PAINT.
The current position can be returned using the
POINT(1) functions. It is set
by the x2, y2 parameters from the LINE and RECT commands and x1, y1 parameters from PSET.
The current position can also be updated using the DRAW command.
Note, “STEP” may also be used with the FOR loop statement as the incremented value each time the
loop is repeated.
The x/y factor.
FILLED keyword fills the result of the command with the drawing color.