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 - invcolor() swap fore/background values in a color attribute http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 invcolor()          Swap fore/background values in a color attribute
------------------------------------------------------------------------------
 Declaration
   color.hdr

 Syntax
   func uint invcolor extern
   param value uint uColorAttribute

 Arguments
   uColorAttribute is the color attribute to swap.

 Return
   A color attribute value.

 Description
   This function swaps the foreground and background values in a color
   attribute, i. e. bits 4...6 and bits 2...0 will be swapped. The function
   is handy to determine the corresponding inverse equivalent for a given
   color attribute.

 Example
   #define EXAMPLE_SCREEN
   #include example.hdr

   proc Test_invcolor
   __syscolor[ CLR_STD ] := BLUE_WHITE
   ? "Hello"                                   // displays white on blue
   __syscolor[ CLR_STD ] := invcolor( __syscolor[ CLR_STD ] )
   ? "Hello"                                   // displays blue on white
   __syscolor[ CLR_STD ] := invcolor( __syscolor[ CLR_STD ] )
   ? "Hello"                                   // displays white on blue again
   endproc

   proc main
   Test_invcolor()
   endproc

See Also: swapcolors()

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