xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

InvertAttr()

Exchanges the foreground and background color.

Syntax

InvertAttr( <xColor> ) --> nInvertedAttribute

Arguments

<xColor>
This is either a single color value (see SetColor()), or its numeric color attribute (see ColorToN()).

Return

The function returns the color attribute of the inverted color as a numeric value

Info

See also:NtoColor(), ScreenAttr()
Category: CT:Video , Screen functions
Source:ct\color.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays a (inverted) color attribute and the
// corresponding SetColor() values.

   PROCEDURE Main
      LOCAL nColorAttr  := GetClearA()
      LOCAL nInvertAttr := InvertAttr( nColorAttr )

      CLS
      ? nColorAttr                    // result:   7
      ? nInvertAttr                   // result: 112.00

      ? NToColor( nColorAttr , .T. )  // result: W/N
      ? NToColor( nInvertAttr, .T. )  // result: N/W
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe