Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Telepathy Communications Library - <b>tp_tcolor()</b> - control emulator display colors http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   tp_tcolor() - control emulator display colors

   nOldAttr := tp_tcolor([nNewAttr], [nNewBkgnd])

   nNewAttr    New display attribute.
   nNewBkgnd   New background attribute.

   Returns     Original display attribute.

   This function can be used to control the terminal emulator's display
   colors when called from the exception handler or a notification
   handler while the emulator is running.

   Attributes are numbers which represent display colors.  An attribute
   combines a foreground color (from 0 to 15), background color (0 to
   7), and blink bit into a single number from 0 to 256.  The foreground
   colors on a color monitor are:

       Value   Color       SET COLOR   |   Value   Color       SET COLOR
       --------------------------------+--------------------------------
         0     Black           N       |     8     Dark grey       N+
         1     Blue            B       |     9     Light blue      B+
         2     Green           G       |    10     Light green     G+
         3     Cyan            BG      |    11     Light cyan      BG+
         4     Red             R       |    12     Light red       R+
         5     Magenta         BR      |    13     Light magenta   BR+
         6     Brown           GR      |    14     Yellow          GR+
         7     White           W       |    15     Bright white    W+

   The background colors are the same as foreground colors 0 to 7.  An
   attribute is formed by adding a foreground color, a background color
   multiplied by 16, and optionally 128 for blinking foreground.

   With a monochrome display (MDA or Hercules, but NOT a monochrome
   VGA), the available colors are:

       Value   Attribute                                       SET COLOR
       -----------------------------------------------------------------
         0     Invisible (black on black)                          X
         1     Underlined                                          U
         7     Normal text                                         W
         9     Bright underlined                                   U+
        15     Bright                                              W+
       112     Reverse (white on black)                            I

   Again, 128 can be added for a blinking foreground.

   The emulator has two color attributes.  The text attribute is the
   value returned by tp_tcolor().  It is the color in which new text is
   displayed.  The background attribute is the one that fills empty
   space when the screen is cleared or scrolled.  Normally the two are
   the same in TTY and ANSI emulation.  In VT102 emulation, the
   background attribute is normally 7 (white on black), no matter what
   the text attribute is.

   Calling tp_tcolor() with the nNewAttr parameter sets both the text
   and the background attribute.  If you want the background attribute
   set differently, you must also pass a nNewBkgnd parameter.

See Also: tp_tflags() Terminal Emulators

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