35 lines
680 B
Plaintext
35 lines
680 B
Plaintext
Width% = 200
|
|
Height% = 200
|
|
|
|
REM Set window size:
|
|
VDU 23,22,Width%;Height%;8,16,16,128
|
|
|
|
REM Fill with an RGB colour:
|
|
PROCfill(100,150,200)
|
|
|
|
REM Set a pixel:
|
|
PROCsetpixel(100,100,255,255,0)
|
|
|
|
REM Get a pixel:
|
|
rgb% = FNgetpixel(100,100)
|
|
PRINT RIGHT$("00000" + STR$~rgb%, 6)
|
|
END
|
|
|
|
DEF PROCfill(r%,g%,b%)
|
|
COLOUR 1,r%,g%,b%
|
|
GCOL 1+128
|
|
CLG
|
|
ENDPROC
|
|
|
|
DEF PROCsetpixel(x%,y%,r%,g%,b%)
|
|
COLOUR 1,r%,g%,b%
|
|
GCOL 1
|
|
LINE x%*2,y%*2,x%*2,y%*2
|
|
ENDPROC
|
|
|
|
DEF FNgetpixel(x%,y%)
|
|
LOCAL col%
|
|
col% = TINT(x%*2,y%*2)
|
|
SWAP ?^col%,?(^col%+2)
|
|
= col%
|