Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create palette.bas #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions basic/palette.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
10 REM DISPLAYS THE DEFAULT PALETTE
15 REM MOVE THE MOUSE TO SEE THE COLOR VALUE
20 DIM P$(15,15)
30 XS=10:YS=10
40 SCREEN 128
50 RECT 0,0,319,239,0
60 C=0
70 FOR Y=0 TO 15
80 Y1=Y*YS:Y2=Y1+YS-1
90 Y3=Y1+8
100 FOR X=0 TO 15
110 X1=X*XS:X2=X1+XS-1
120 X3=X1
130 RECT X1,Y1,X2,Y2,C
140 CX=$FA00+C*2
150 C$=HEX$(VPEEK($1,CX))+HEX$(VPEEK($1,CX+1))
170 P$(X,Y) = C$
180 C=C+1
190 NEXT
200 NEXT
210 MOUSE 1
220 X=INT(MX/XS)
230 Y=INT(MY/YS)
240 IF X<0 OR X>15 THEN 220
250 IF Y<0 OR Y>15 THEN 220
260 LOCATE 21,9
270 PRINT P$(X,Y)
280 GOTO 220