PSET

SmallBASIC syntax groups: 


Graphics command PSET


10
20  PSET [STEP] x,y [, color| COLOR color]
30
Draw a pixel.


See examples


If there is insufficient information on this page and you wish learn more about PSET, please send an email to smallbasic@gmail.com. You can help to improve information about PSET by submitting an article using the comments link below. Note, an offline language reference text file is now avialable – see the Download section.

Comments

cx=xmax/2  'center x, xmax is built in constant that returns the screen width
cy=ymax/2  'center y, ymax is built in constant that returns the screen height
MyColor=RGB(255,128,0)  'orange?

PSET cx,cy,MyColor   'draws an orange pixel at center of screen

(see also STEP that works off the last x,y graphic call)
for instance now that one graphic call is made, we can draw a point 50 pixels directly to the right using STEP
PSET STEP 50,0,MyColor

Without a color specified in 3rd argument PSET will use foreground from last COLOR foreground, background statement.
IF that had never been used it will default to screen printing colors 7,0 (QB scale)
for Colors see RGB, RGBF, and ... hmmm do we have a QB color sampler?

Here is QB color chart:

'QB color chart of 16 colors for 0 = black to 15 = bright white
dy=ymax/16
for i=0 to 15
  rect 0,i*dy,xmax,i*dy+dy,i filled
  at 0,i*dy:? i;
next
pause

Here is PSET with QB red at center screen:
PSET xmax/2,ymax/2,12
12 is QB red, 9 is blue, 14 is yellow, 7 dull white, 0 black, 8 is darker gray than 7 usually the colors get brighter