The SETCOLOR.exe utility program provides extensive control over colors for your running system. With this program, the user can view the current colors, select colors for use, create and apply named color schemes, edit the color palette, set the border color, and save and load color definitions. Changes made with SETCOLOR.exe are in effect only as long as your system is running. To change the colors for system startup, use the NEWAPLUS.exe program. SETCOLOR.exe is executed by a command of the form:
SETCOLOR <keyword> [<keyword> ... ]
where each <keyword> selects a foreground or background color or other option. If no <keyword> is supplied, you are presented with a menu of choices:
Color selection submenus let you choose from the current 16-color palette the screen colors that will be used for text foreground and background. ANSIPLUS maintains two sets of foreground and background colors: those that are currently on the screen, and default colors to be applied when an ANSI Set Graphics Rendition reset (i.e., Esc [0m ) is detected. You can control both color combinations from this sub-menu.
The color palette determines the precise colors you will see in 16 color video modes. ANSIPLUS maintains two palettes: the current palette on the screen, and a default palette that is loaded when ANSIPLUS first starts and whenever the video display mode is changed. You can control both palettes using this option, but unless you specifically set the default for each color you redefine, your colors will only apply until the next display mode change.
The border color is generated for the "overscan" region on the outside edges of the screen. Again, ANSIPLUS maintains both a current border color and a default border color. You can select any available color as border color, and can control both the current and default borders with this option. As for palette changes, unless you specifically set the default border color, your border color will apply only until the next display mode change.
From the command line, colors may be selected by name or code number, where codes 0-15 identify the 16 palette colors, 128-143 select foreground colors, and 192-207 select background colors. The relationship between color names and code numbers is depicted in the following table:
|
In 256 color modes, you may also use 256-511 to select the foreground, 512-767 to select the background, or 0-255 after the BORDER keyword to select the border color.
Several modifying keywords can assist the color selection:
DARK, DIM or NORMAL | Low intensity colors |
LIGHT, BRIGHT or INTENSE | High intensity colors |
FOREGROUND or FGD | Foreground following |
BACKGROUND, BGD, or ON | Background following |
REVERSE | Swap the current foreground and background |
BORDER | Border color selection following |
DEFAULT | Select the current colors as the default colors |
If named colors or color codes 0-15 are specified without the foreground or background keywords, then the first color is assumed to be the foreground and the second the background. Keywords may also be shortened; the first partial match will be used. Several examples may help to clarify these rules:
SETCOLOR bgd blue | Sets the background to dark blue |
SETCOLOR light cyan blue default | Default colors are light cyan foreground and blue background |
SETCOLOR 7,0 | Gray foreground, black background |
SETCOLOR bright green on blue | High intensity green foreground, dark blue background |
SETCOLOR border cyan | Set the border color to cyan |
SETCOLOR reverse | Reverses (swaps) the current foreground and background colors |
SETCOLOR rev | Reverses foreground and background |
Any unmatched keywords are checked against user-defined color schemes in a file named SETCOLOR.sch. This editable ASCII text file, which should be placed in the same directory as the SETCOLOR.exe program, contains any number of named color schemes of the user’s choice. User supplied color schemes are entered into the file with a text editor, with each line entered in the form:
<name> = <keyword> [<keyword> ... ]
where <name> is the name of the user supplied color scheme, and <keyword> is any valid SETCOLOR program keyword or other option. The follwing table shows the color scheme for each line of the SETCOLOR.sch file included with ANSIPLUS as a sample:
|
A user color scheme may be specifically selected on the SETCOLOR command line by preceding its name with the keyword SCHEME, for example:
SETCOLOR SCHEME JOE | Selects a color scheme named JOE |
The SETCOLOR program also includes keyword options to reset, edit, load and save the current color configuration. These include:
RESET | Install defaults as the current colors |
IBM or OEM | Install the OEM VGA/EGA palette as the current colors |
PALETTE | Edit the color definitions for the 16-color palette |
SAVEFILE <filename> | Save the current 16-color definitions in a file |
SAVE256 <filename> | Save the 256 VGA DAC color definitions in a file |
LOADFILE <filename> | Load a color definition file |
SAVECURRENT <file> | Save the 16 current colors as an executable program |
SAVEDEFAULT <file> | Save the 16 default colors as an executable program |
SAVEPROGRAM <file> | Save both the current and default colors as a program |
The SAVEFILE, SAVE256 and LOADFILE keywords generate and load color definition files. The color definition files created by SAVEFILE contain 36 lines: 32 lines define the red, green and blue intensities for colors 0 to 15, both current and default, and the other four define the current and default foreground, background and border colors. Files created by SAVE256 contain 512 lines: 256 for the default DACs and 256 for the current DACs. The table to the right is a sample of lines from a SAVEFILE color definition file. Users are free to edit color definition files to create their own colors, to delete any lines from them, or to put the lines in any order except that all default color definitions must precede all current color definitions in the file. If no file name is given for a LOADFILE, SAVEFILE or SAVE256 request, the file name SETCOLOR.def in the current directory will be used. LOADFILE checks the system PATH for color definition files to be loaded, so any commonly used color files can reside in a directory on the PATH. |
|
The SAVECURRENT, SAVEDEFAULT, and SAVEPROGRAM keyword options create executable ".com" files that can be called later by name to install colors. These programs can also be edited by the ANSICOM.exe utility program.
To provide additional user control over 16-color programs, such as DBASE III or DOS 5.0 EDIT.com, that set their own palettes or border colors but do not restore the palette on completion, or to simply force a color scheme on a program that defines its own, ANSIPLUS can lock the color palette, preventing a program from loading the PAL/DAC and border color registers by BIOS calls. This feature is controlled by two SETCOLOR options:
LOCKPAL | Enable locked color palette, ignore BIOS calls defining colors |
UNLOCKPAL | Disable locked color palette, allow programs to define colors |
Palette locking should only be used when all other means of control fail. It is intended to be invoked as part of batch files that execute applications to be controlled, locking the palette before the program runs, and unlocking it after it completes. The feature should never be enabled all of the time because it will keep well behaved programs from making color changes too.
The SETCOLOR program also controls ANSIPLUS VGA monochrome monitor emulation. Two keywords enable or disable this feature:
MONOCHROME | Begins VGA monochrome monitor emulation |
COLOR | Ends VGA monochrome monitor emulation and restores colors |
And finally, SETCOLOR provides three reporting options:
SHOW | Displays the 16 current colors in a band across the screen |
HELP | Gives a brief description of how to use the SETCOLOR program |
SCHEME HELP | Lists the available color schemes in file SETCOLOR.sch |
© Copyright 2000-2007, Kristofer Sweger. All rights reserved. |
Rev. 10/16/07 |