Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - set color to control the console color http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 set color to        Control the console color
------------------------------------------------------------------------------
 Syntax
   set color to [cColorString]

 Arguments
   cColorString is a string containing color specification in the following
   format:

   "<ForeStd/BackStd>[, <ForeEnhcd/BackEnhcd>[, <ForeScore/BackScore>]]"

   where Fore... and Back... are color values for the definition of
   foreground and background colors.  The two elements in each color
   specification are separated by a slash (/). See the Color string
   table for color codes.

   The Fore/BackStd substring sets the color for standard input and
   output through the ?, input, accept, and say commands. The Fore/BackEnhcd
   substring sets the color for enhanced input and output through the
   get command. The Fore/BackScore substring sets the color of the
   scoreboard indicators.

 Description
   The set color to command controls the color and attributes of the console,
   according to the color specification supplied via the cColorString
   parameter. If set color to is specified without the cColorString
   expression it resets the colors to their default values.

   Colors can be directly set through the __syscolor[] system array
   whose values are adjusted also by the set color to command. Assigning
   byte values to __syscolor[] results in more efficient code in comparison
   to using character strings to be parsed by the set color to command.

 Example
   #define EXAMPLE_SCREEN
   #include example.hdr

   vardef
      char( 20 ) cName := "Isabelle"
   enddef
   
   proc Test_setcolorto
   clear
   ? "Hello"                   // default color
   set color to "BG/N, R/W, G"
   set scoreboard on
   ? "Hello again"             // cyan on black
   @ 4, 0 get cName // this field is red on white with green scoreboard
   read
   endproc

   proc main
   Test_setcolorto()
   endproc

See Also: Color string table __syscolor

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson