>Hi,
>
>I have a vfp desk top app that allows users to pick the color of the captions on their command buttons and store thenm in a table. I have a web interface to the table and would like to have the button captions to be displayed in the colors they picked in their desktop interface to the table. But vfp red = 255 and html red is #ff0000. How do you convert vfp color codes to html color codes?
>
>Neil
Hi Neil,
Use the following function to convert RGB values to HTML color codes.
Function RGB2HTMLColor( tnRGB)
Local lnRed, lnGreen, lnBlue
lnRed = Mod( m.tnRGB, 256)
lnGreen = Mod( Int( m.tnRGB/256), 256)
lnBlue = Mod( Int( m.tnRGB/65536), 256)
Return "#" + ;
Right( Transform( m.lnRed, "@0"), 2) + ;
Right( Transform( m.lnGreen, "@0"), 2) + ;
Right( Transform( m.lnBlue, "@0"), 2)
EndFunc
HTH
Alex