darrellblackhawk
Programmer
Code:
* Function: InvertIntRGB()
* Descript: Inverts an integer RGB value
* Pass: R,G,B (Output i.e. Pass in by reference)
* They will contain the numeric (dec)
* RGB values upon return
*
* bDecString (Input)
* If .t., the function will return a
* comma separated, zero padded decimal
* string.
*
* Note: The real numeric values are in R,G,B upon exit
*
* Useful to perform masking and other
* paint functions
function InvertIntRGB
lparam I, R, G, B, bDecString
local cRGB
=IntToRGB(bitxor(I,16777215),@R,@G,@B)
cRGB = ;
right(trans(R,"@0"),2) + ;
right(trans(G,"@0"),2) + ;
right(trans(B,"@0"),2)
return iif(bDecString, ;
padl(trans(R),3,"0")+","+ ;
padl(trans(G),3,"0")+","+ ;
padl(trans(B),3,"0"), ;
cRGB)
endfunc