Re: Get color pair by Roger
Roger
Wed Dec 31 08:14:20 CST 2003
budieko <eko_dja@myrealboxJUSTREMOVE.com> wrote:
> ? RGB(255,255,255) &&display 16777215
>
> What is the function to convert 16777215 into pair of 255,255,255 ?
>
> Thank to all
Try ...
?ColorNumToRGB(16777215)
Function ColorNumToRGB
LPARAMETERS nColor
LOCAL lnR,lnG,lnB
lnR=BITRSHIFT(BITLSHIFT(nColor,24),24)
lnG=BITRSHIFT(BITLSHIFT(nColor,16),24)
lnB=BITRSHIFT(nColor,16)
RETURN "RGB("+TRAN(lnR)+","+TRAN(lnG)+","+TRAN(lnB)+")"
EndFunc
-Roger
--
Roger Ansell
Australian President
FE AVP et Cie
Adelaide, Australia
My real email address is ransell at senet dot com dot au