ConColor command

 

Usage:

ConColor ForeGround& [,BackGround& [,Count&]]

 

Legacy Syntax:

COLOR [ForeGround&],[BackGround&][,Count&]

 

Pseudo-object Syntax:

CON.COLOR [ForeGround&],[BackGround&][,Count&]

 

Sets the text foreground and background colors for the active console page.

 

Defines the foreground and background colors for future output to the active screen page (other pages, if any, are not affected), or changes the colors of current cells. Foreground& is a value from 0 to 15, which specifies the character color. Background& is a value from 0 to 15, which specifies the background color. If either is specified as -1, that color is left unchanged.

 

If the optional Count& is included, it causes the color attribute to be applied immediately to that number of character cells, starting at the current caret location. The caret is not moved, and the underlying characters are not changed.

 

  0 = Black          8 = Gray

  1 = Blue           9 = Light Blue

  2 = Green         10 = Light Green

  3 = Cyan          11 = Light Cyan

  4 = Red           12 = Light Red

  5 = Magenta       13 = Light Magenta

  6 = Brown         14 = Yellow

  7 = White         15 = Intense White

 

The user has the ability to customize the 16 console colors with later versions of Windows - they are not necessarily the 16 fixed colors listed above. For example, the user may have modified color 15 to be a cream color. When your program uses color 15 for either foreground or background, cream will be produced, not intense white.

 

Conversion:

 

#IF %DEF(%PB_CC32)

  COLOR Foreground&, Background&, Count&

#ELSE

  ConColor Foreground&, Background&, Count&

#ENDIF

 

#IF %DEF(%PB_CC32)

  COLOR Foreground&

#ELSE

  ConColor Foreground&

#ENDIF

 

#IF %DEF(%PB_CC32)

  COLOR , Background&

#ELSE

  ConColor -1, Background&

#ENDIF

 

CON.COLOR or CONSOLE.COLOR may be substituted for COLOR in programs written for PB/CC 6.

 

See Also: ConSetAttr, ConGetAttr