Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending instructions to MS Outlook
Message
From
09/05/2005 10:15:29
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01012145
Message ID:
01012160
Views:
19
>>For question no. 2, I made this function
>>Function getwebcolor
>>Return Substr(Transform(GetColor(),'@0'),5)
>>So to convert a numeric color value into hex, you can use
>>lcHexColor=Substr(Transform(lnColor,'@0'),5)
>>
>
>Tore,
>
>It would be BGR instead of RGB.

Update:

here are the CORRECT functions:
Function getwebcolor
LPARAMETERS lxPrefix
LOCAL lcHex,lcReturn
lcReturn=IIF(PCOUNT()>0,'#','')
lcHex=Transform(GetColor(),'@0')
Return lcReturn + RIGHT(lcHex, 2) + SUBSTR(lcHex, 7,2) + SUBSTR(lcHex, 5,2)
Function num2webcolor
LPARAMETERS lnColor,lxPrefix
LOCAL lcHex,lcReturn
lcReturn=IIF(PCOUNT()>1,'#','')
lcHex=Transform(lnColor,'@0')
Return lcReturn + RIGHT(lcHex, 2) + SUBSTR(lcHex, 7,2) + SUBSTR(lcHex, 5,2)
Previous
Reply
Map
View

Click here to load this message in the networking platform