1000 '"COLORSET" A Program to test color attributes in Basic
1010 'Requires Color Graphics Board and Color Monitor
1020 REV$="Rev: 830120"'By Robert Hamilton
1030 SCREEN 0,0,0:WIDTH 40:COLOR 2,0,0:KEY OFF:CLS:UP$=STRING$(1,30)
1040 LOCATE ,,1,12,13:DEF SEG=0:IF PEEK (&H410)= 109 THEN LOCATE ,,,6,7
1050 DEF SEG=64:POKE 23,32:DEF SEG:CL$=STRING$(79,0):Q$=CHR$(34)
1060 LOCATE 5,13:PRINT"C O L O R S E T";CHR$(10);TAB(15);REV$
1070 LOCATE 24,2:COLOR 0,7:PRINT " ENTER ";:COLOR 5,0:PRINT" For Color   ";
1080 COLOR 0,7:PRINT " M ";:COLOR 5,0:PRINT" Monochrome";:COLOR 6,0
1090 K$=INKEY$:IF MID$(K$,1,1)="m" OR MID$(K$,1,1)="M" THEN CLS:LOCATE 24,1:GOSUB 1520:GOTO 1140
1100 IF K$="" THEN 1090
1110 CLS:LOCATE 24,1
1120 DEF SEG=0:POKE &H410, (PEEK(&H410) AND &HCF) OR &H10:DEF SEG
1130 SCREEN 1,0,0,0:SCREEN 0,1:WIDTH 40:LOCATE ,,1,6,7:COLOR 10,0,2
1140 LOCATE 5,13:PRINT"C O L O R S E T";CHR$(10);TAB(15);REV$
1150 LOCATE 11,8:COLOR 11:PRINT "Foreground colors 0 to 15"
1160 LOCATE 12,10:COLOR 11:PRINT "Add 16 to  ";:COLOR 27:PRINT"Foreground"
1170 LOCATE 14,8:COLOR 12,2:PRINT " Background colors 0 to 7 "
1180 LOCATE 16,10:COLOR 2,0:PRINT "Border colors 0 to 15"
1190 COLOR 6:LOCATE 20,2:PRINT"NOTE: To change width, Enter 40 or 80.
1200 GOSUB 1410:LOCATE 23,1:COLOR 14,0:PRINT STRING$(39,0);:LOCATE 23,1
1210 LINE INPUT;" COLOR For,Bac,Bor (Q=End) ==> ",F$
1220 IF INSTR(F$,"Q")<>0 OR INSTR(F$,"q")<>0 THEN 1370
1230 IF F$="" THEN PRINT:GOTO 1200
1240 SEP=INSTR(F$,","):SEP2=INSTR(SEP+1,F$,","):IF SEP=0 THEN F=VAL(F$):D=VAL(F2$):GOSUB 1380:GOTO 1290
1250 F1$=LEFT$(F$,SEP-1):IF F1$<>"" THEN F=VAL(F1$)
1260 IF SEP2=0 THEN F2$=MID$((F$),SEP+1):B=VAL(F2$):GOTO 1290
1270 F2$=MID$((F$),SEP+1,SEP2-1):IF LEFT$(F2$,1)<>"" AND LEFT$(F2$,1)<>"," AND LEFT$(F2$,1)<>" " THEN B=VAL(F2$)
1280 F3$=MID$((F$),SEP2+1):IF LEFT$(F3$,1)<>"" AND LEFT$(F3$,1)<>"," AND LEFT$(F3$,1)<>" " THEN BOR=VAL(F3$)
1290 IF F<0 OR F>31 THEN BEEP:GOTO 1360
1300 IF B<0 OR B>7 THEN BEEP:GOTO 1360
1310 IF BOR<0 OR BOR>15 THEN BEEP:GOTO 1360
1320 LOCATE 23,1:PRINT TAB(2);"COLOR ";
1330 PRINT USING "## ,";F,B;
1340 PRINT BOR;TAB(21);" = ";
1350 COLOR F,B,BOR:PRINT " THIS IS A TEST ";:COLOR 6,0
1360 PRINT CHR$(10):GOTO 1200
1370 GOSUB 1520:DEF SEG=64:POKE 23,128:DEF SEG:WIDTH 80:COLOR 6,0,0:END
1380 IF F=40 THEN WIDTH 40:WID=0:GOTO 1360
1390 IF F=80 THEN WIDTH 80:WID=1:GOTO 1360
1400 RETURN
1410 LOCATE 24,1:IF WID=1 THEN LOCATE 25,1
1420 COLOR 7,0:PRINT"  Blk 7,0 ";
1430 COLOR 9,1:PRINT" Blu 9,1 ";
1440 COLOR 10,2:PRINT" Grn 10,2 ";
1450 COLOR 11,3:PRINT" Cyn 11,3 ";
1460 IF WID=0 THEN LOCATE 25,1
1470 COLOR 12,4:PRINT" Red 12,4 ";
1480 COLOR 13,5:PRINT" Mag 13,4 ";
1490 COLOR 14,6:PRINT" Yel 14,6 ";
1500 COLOR 15,7:PRINT" Wht 15,7";
1510 RETURN
1520 REM: MONO
1530 DEF SEG=0:POKE &H410,(PEEK(&H410) OR &H30):SCREEN 0:WIDTH 80
1540 LOCATE 24,1,1,12,13:RETURN