DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

setcolor(C)


setcolor, setcolour -- set color and other attributes of the console screen

Syntax

setcolor - [ bcgknopr ] argument [ argument ]

Description

The setcolor command allows the user to set the screen color on a color console screen. Both foreground and background colors can be set independently in a range of 16 colors. setcolor can also set the reverse video and graphics character colors. setcolor with no arguments produces a usage message that displays all available colors, then resets the screen to its previous state.

For example, the following strings are possible colors:

blue magenta brown black
lt_blue lt_magenta yellow gray
cyan white green red
lt_cyan hi_white lt_green lt_red

 blue         magenta         brown         black
 lt_blue      lt_magenta      yellow        gray
 cyan         white           green         red
 lt_cyan      hi_white        lt_green      lt_red
The following flags are available. In the arguments below, color is taken from the above list.

-b color
Set the background to the specified color.

-c first last
Set the first and last scan lines of the cursor. (For more information see screen(HW).)

-g f_color [b_color].
Set the foreground graphics characters to the first color f_color. Set graphics characters' background to second color b_color if specified.

-k
Switch on keyclick option.

-n [f_color [b_color] ]
Reset the screen to default settings, and switch off -k option. If no arguments are given the screen is set to white characters on a black background; otherwise the specified colors are used. The foreground is set to the first color f_color. The background is set to the second color if b_color is specified.

-o
Set the color of the screen border (overscan region). This only works on CGA adaptors.

-p pitch duration
Set the pitch and duration of the bell. Pitch is the period in microseconds, and duration is measured in fifths of a second. When using this option, a <Ctrl>g (bell) must be echoed to the screen for the command to work. For example:

setcolor -p 2500 2
echo ^G


-r f_color [b_color]
Set the foreground reverse video characters to the first color f_color. Set reverse video characters' background to the second color b_color if specified.

Limitations

setcolor only works on the console.

setcolor's ability to set a desired attribute depends on the console's ability to support it. setcolor may not have an effect on monochrome consoles.

Occasionally changing the screen color can help prolong the life of your monitor.

See also

screen(HW)

Standards conformance

setcolor and setcolour are not part of any currently supported standard; they are extensions of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003