QuickChange
Easy Color Setting For The IBM PC/PCjr
Paul Carlson
Customize the colors of your text screens with this handy program that allows you to easily change the border, background, and foreground colors at any time—without losing the information on your screen. For DOS versions 2.0 and higher. A color display is required.
"QuickChange" lets you choose the colors for your text screen. You'll be suprised at how refreshing—and sometimes much more readable—it can be to work with a new set of colors.
QuickChange is a terminate-and-stay-resident program (TSR) that runs silently in the back ground, waiting for you to call it. When summoned, it lets you quickly enter new foreground, background, and border colors.
You may already be familiar with the two most common ways to change screen colors. The first is to load the ANSI.SYS driver while including the color-setting escape sequences in the DOS prompt, using the PROMPT command. The problem with this approach is that, once set, the colors are difficult to change. The other common approach is to change screen colors with a machine language program that scrolls the entire screen up 25 lines, filling each line with the desired color attribute bytes. Unfortunately, this method clears the screen. QuickChange avoids these problems, changing the colors of the entire screen without clearing it.
Type in and save the BASIC program listed below. It creates a machine language program called SETCOLOR.COM, so be sure you don't use that name when you save the BASIC program itself. Once the SETCOLOR.COM file is created, you won't need the BASIC program again except to create new copies of SETCOLOR.COM.
To begin using QuickChange, make sure the SETCOLOR.COM file is on the disk in the current drive, or—if using a hard disk—make sure it's in a directory included in the DOS search path, and then simply type SETCOLOR at a DOS prompt. Like many TSR programs, after QuickChange is run, it waits to be activated by a specific combination of keypresses. As listed, Alt-C activates QuickChange. If another of your programs already uses this combination, choose another combination for this program. Use the following table to select the new key combination. Replace the value 46 in line 30 with the number corresponding to your choice, then run the program again to create a new copy of SETCOLOR.COM.
Alt-A | 30 |
Alt-B | 48 |
Alt-C | 46 |
Alt-D | 32 |
Alt-E | 18 |
Alt-F | 33 |
Alt-G | 34 |
Alt-H | 35 |
Alt-I | 23 |
Alt-J | 36 |
Alt-K | 37 |
Alt-L | 38 |
Alt-M | 50 |
Alt-N | 49 |
Alt-O | 24 |
Alt-P | 25 |
Alt-Q | 16 |
Alt-R | 19 |
Alt-S | 31 |
Alt-T | 20 |
Alt-U | 22 |
Alt-V | 47 |
Alt-W | 17 |
Alt-X | 45 |
Alt-Y | 21 |
Alt-Z | 44 |
A Custom Screen
Run QuickChange each time the computer is turned on or reset. If you have an AUTOEXEC.BAT file on your system disk, you may want to add a line with the command SETCOLOR. With this command in the AUTOEXEC file, QuickChange will run automatically each time you boot your computer. (Note: This requires that you have a copy of SETCOLOR.COM on your boot disk or in the same hard disk subdirectory as the DOS system files.)
Anytime you wish to change colors, press Alt-C (or whatever other combination you selected). A window appears on the screen containing a menu of the items BORDER, BACKGROUND, and FORE-GROUND, with the first item highlighted. You can move the highlight bar to any of the three items using the cursor keys. You can step through all the available colors for the highlighted item by using the cursor right key. This makes it easy to select a pleasing combination. After you're satisfied with your color selections, press the Esc key to remove the window.
This program works in either 40- or 80-column color text mode. If your display is in any other mode, pressing the Alt-key combination has no effect.
If your DOS prompt includes color-setting escape sequences, they should be removed; otherwise, the prompt will regularly destroy your color choices. For instance, the ANSI.SYS program is often loaded along with DOS. Check your boot disk for a file named CONFIG.SYS. If that file exists and contains the line DEVICE=ANSI.SYS, then the program is being loaded. The fore-ground and background colors set by ANSI.SYS, when DOS boots, will take precedence over the colors chosen with QuickChange. To prevent this from happening, use a text editor or word processor to remove the DEVICE=ANSI.SYS line from the CONFIG.SYS file. If the CONFIG.SYS file isn't needed for some other purpose, you can delete it from your DOS disk altogether, but you should check carefully before taking this step.
Some application programs may select their own color combinations. Within such programs, QuickChange has no lasting effect. One example is the BASIC interpreter. Although you can use QuickChange to change the screen colors while using the BASIC, any output from BASIC will be printed in white characters on a black background.
QuickChange
For instructions on entering these programs, please refer to "COMPUTE!'s Guide to Typing in Programs" elsewhere in this issue.
GK 1 'Program to create SETCOLOR.COM OA 2 'COPYRIGHT 1987 COMPUTE! PUBLICATIONS, INC. OC 3 'ALL RIGHTS RESERVED. KK 4 CLS : PRINT "COPYRIGHT 1987" : PRINT "COMPUTE! PUBLICATIONS, INC." : PRINT "ALL RIGHTS RESERVED." KD 5 FOR ZZ = 1 TO 1500 : NEXT : CLS OO 6 PRINT "CREATING SETCOLOR.COM . . . . . . . PLEASE WAIT." NC 10 OPEN "SETCOLOR.COM" FOR OUTPUT AS 1 PO 20 PRINT#1, CHR$ (&HE9); CHR$ (&H32); CHR$ (&H4); CJ 30 PRINT#1, CHR$ (46); AB 40 FOR N = 1 TO 146 : PRINT#1, CHR$(0); : NEXT PP 50 T = 0 : FOR J = 1 TO 963 : READ A$ : N = VAL ("&H" + A$) FD 60 T = T + N : PRINT#1, CHR$ (N) ; : NEXT : CLOSE 1 OE 70 IF T = 88099! THEN PRINT"SETCOLOR.COM SUCCESSFULLY CREATED!" : END NE 80 DATA 00, 00, 00, 00, 00, 00, C9, 07, CD, 07 LP 90 DATA CD, 07, CD, 07, CD, 07, CD, 07, CD, 07 MD 100 DATA CD, 07, CD, 07, CD, 07, CD, 07, CD, 07 KE 110 DATA CD, 07, BB, 07, BA, 07, 20, 07, 42, 07 NC 120 DATA 4F, 07, 52, 07, 44, 07, 45, 07, 52, 07 IP 130 DATA 20, 07, 20, 07, 20, 07, 20, 07, 20, 07 NG 140 DATA BA, 07, BA, 07, 20, 07, 42, 07, 41, 07 LL 150 DATA 43, 07, 4B, 07, 47, 07, 52, 07, 4F, 07 GK 160 DATA 55, 07, 4E, 07, 44, 07, 20, 07, BA, 07 QK 170 DATA BA, 07, 20, 07, 46, 07, 4F, 07, 52, 07 KB 180 DATA 45, 07, 47, 07, 52, 07, 4F, 07, 55, 07 PB 190 DATA 4E, 07, 44, 07, 20, 07, BA, 07, C8, 07 ME 200 DATA CD, 07, CD, 07, CD, 07, CD, 07, CD, 07 MB 210 DATA CD, 07, CD, 07, CD, 07, CD, 07, CD, 07 BH 220 DATA CD, 07, CD, 07, BC, 07, 00, 00, 00, 00 BD 230 DATA 2E, 80, 3E, 04, 01, 00, 75, 22, FB, 50 EK 240 DATA 53, 51, 52, 56, 57, 1E, 06, E4, 60, 2E BC 250 DATA 3A, 06, 03, 01, 75, 08, B4, 02, CD, 16 DK 260 DATA A8, 08, 75, 0D, 07, 1F, 5F, 5E, 5A, 59 OK 270 DATA 5B, 58, 2E, FF, 2E, 28, 02, E8, C4, 02 QJ 280 DATA 0E, 1F, 0E, 07, B4, 0F, CD, 10, 3C, 01 HI 290 DATA 74, 0D, 3C, 03, 74, 09, 07, 1F, 5F, 5E KE 300 DATA 5A, 59, 5B, 58, CF, A2, 05, 01, C6, 06 OA 310 DATA 9A, 01, 01, C6, 06, 9B, 01, 01, C6, 06 PF 320 DATA 95, 01, 00, C6, 06, 96, 01, 00, C6, 06 BJ 330 DATA 97, 01, 00, 88, 3E, 06, 01, C6, 06, 04 QJ 340 DATA 01, 01, B4, 03, CD, 10, 89, 0E, 07, 01 BP 350 DATA B4, 01, E8, 51, 02, E8, 1E, 01, E8, 96 BM 360 DATA 01, E8, DE, 01, E8, 5D, 02, B4, 00, CD KA 370 DATA 16, 3C, 1B, 75, 03, E9, 95, 00, 80, FC MA 380 DATA 48, 75, 10, 80, 3E, 9A, 01, 01, 74, E9 QL 390 DATA FE, 0E, 9A, 01, E8, BD, 01, EB, E0, 80 AC 400 DATA FC, 50, 75, 10, 80, 3E, 9A, 01, 03, 74 DE 410 DATA D4, FE, 06, 9A, 01, E8, A8, 01, EB, CB DE 420 DATA 80, FC, 4D, 75, C6, 80, 3E, 9A, 01, 01 CB 430 DATA 75, 1C, FE, 06, 95, 01, 80, 26, 95, 01 PO 440 DATA 07, E8, F8, 01, B8, 00, 0B, B7, 00, 8A BB 450 DATA 1E, 95, 01, CD, 10, E8, 02, 02, E8, A3 BE 460 DATA 80, 3E, 9A, 01, 02, 75, 20, FE, 06, 96 OP 470 DATA 01, 80, 26, 96, 01, 07, 8A, 16, 96, 01 LM 480 DATA B1, 04, D2, E2, 88, 16, 99, 01, C6, 06 MH 490 DATA 98, 01, 8F, E8, 38, 00, E9, 7C, FF, FE HL 500 DATA 06, 97, 01, 80, 26, 97, 01, 0F, 8A, 16 QO 510 DATA 97, 01, 88, 16, 99, 01, C6, 06, 98, 01 CJ 520 DATA F0, E8, 1C, 00, E9, 60, FF, E8, A2, 01 LE 530 DATA E8, BE, 00, E8, B4, 01, B4, 01, 8B, 0E NI 540 DATA 07, 01, CD, 10, C6, 06, 04, 01, 00, E9 PI 550 DATA 00, FF, E8, 89, 01, 06, B8, 00, B8, 8E HM 560 DATA C0, B9, D0, 07, B8, 00, 10, 80, 3E, 05 QN 570 DATA 01, 03, 74, 06, B9, E8, 03, B8, 00, 05 LP 580 DATA 8A, 1E, 06, 01, 32, FF, F7, E3, 8B, F8 MM 590 DATA 47, 8A, 36, 98, 01, 8A, 16, 99, 01, 26 FJ 600 DATA 8A, 05, 22, C6, 0A, C2, 26, 88, 05, 47 EB 610 DATA 47, E2, F2, 07, 8D, 3E, 09, 01, 47, B9 MI 620 DATA 46, 00, 8A, 05, 22, C6, 0A, C2, 88, 05 HP 630 DATA 47, 47, E2, F4, E8, 82, 00, E8, CA, 00 DN 640 DATA E8, 49, 01, C3, 06, 0E, 07, BE, 82, 06 FE 650 DATA B8, 00, 10, 80, 3E, 05, 01, 03, 74, 06 QP 660 DATA BE, 3A, 03, B8, 00, 05, 8A, 1E, 06, 01 DH 670 DATA 32, FF, F7, E3, 03, F0, 8D, 3E, 09, 01 MJ 680 DATA 1E, B8, 00, B8, 8E, D8, E8, 03, 00, 1F IL 690 DATA 07, C3, 8B, 05, 00, B8, 84, 00, 2E, 80 KO 700 DATA 3E, 05, 01, 03, 74, 03, B8, 34, 00, B9 LN 710 DATA 1C, 00, F3, A4, 03, F0, 4B, 83, FB, 00 CL 720 DATA 75, F3, C3, 06, 8D, 36, 09, 01, BF, 82 KM 730 DATA 06, B8, 00, 10, 80, 3E, 05, 01, 03, 74 OM 740 DATA 06, BF, 3A, 03, B8, 00, 05, 8A, 1E, 06 CK 750 DATA 01, 32, FF, F7, E3, 03, F8, B8, 00, B8 AF 760 DATA 8E, C0, E8, 2F, 00, 07, C3, 06, 8D, 36 JK 770 DATA 9C, 01, BF, 82, 06, B8, 00, 10, 80, 3E BH 780 DATA 05, 01, 03, 74, 06, BF, 3A, 03, B8, 00 FM 790 DATA 05, 8A, 1E, 06, 01, 32, FF, F7, E3, 03 K8 800 DATA F8, B8, 00, B8, 8E, C0, E8, 03, 00, 07 FB 810 DATA C3, C3, BB, 05, 00, B8, 84, 00, 80, 3E KM 820 DATA 05, 01, 03, 74, 03, B8, 34, 00, B9, 1C LK 830 DATA 00, F3, A4, 03, F8, 4B, 83, FB, 00, 75 FA 840 DATA F3, C3, E8, 67, 00, 06, B8, 00, B8, 8E M8 850 DATA C0, BF, 87, 06, B8, 00, 10, 80, 3E, 05 ND 860 DATA 01, 03, 74, 06, BF, 3F, 03, B8, 00, 05 JD 870 DATA 8A, 1E, 06, 01, 32, FF, F7, E3, 03, F8 MI 880 DATA 8B, F7, 8A, 0E, 9B, 01, BB, A0, 00, 80 BD 890 DATA 3E, 05, 01, 03, 74, 03, BB, 50, 00, 03 IH 900 DATA FB, E2, FC, B0, 07, B9, 0A, 00, 26, 88 DG 910 DATA 05, 47, 47, E2, F9, 8B, FE, 8A, 0E, 9A GJ 920 DATA 01, 03, FB, E2, FC, B0, 70, B9, 0A, 00 OJ 930 DATA 26, 88, 05, 47, 47, E2, F9, A0, 9A, 01 EE 940 DATA A2, 9B, 01, 07, E8, 19, 00, C3, BA, DA EH 950 DATA 03, EC, A8, 08, 74, FB, 83, EA, 02, B0 BB 960 DATA 25, 80, 3E, 05, 01, 03, 74, 02, FE, C8 NL 970 DATA EE, C3, B0, 29, 80, 3E, 05, 01, 03, 74 FF 980 DATA 02, FE, C8, BA, D8, 03, EE, C3, E4, 61 BC 990 DATA 8A, E0, 0C, 80, E6, 61, 8A, C4, E6, 61 JD 1000 DATA FA, B0, 20, E6, 20, FB, C3, B9, 07, 06 CO 1010 DATA B4, 01, CD, 10, B4, 35, B0, 09, CD, 21 BF 1020 DATA 89, 1E, 28, 02, 8C, 06, 2A, 02, B4, 25 JP 1030 DATA B0, 09, 8D, 16, 2C, 02, CD, 21, BA, 36 HD 1040 DATA 05, CD, 27