Page 1 of 1

Can Xbrowse show Hex. Color codes

PostPosted: Wed Nov 08, 2017 11:57 pm
by Marc Venken
Hey,

Can Xbrowse show's a array/dbf with colorcodes in hex. Format like #4286f4

I need to show colors codes in Hex

Re: Can Xbrowse show Hex. Color codes

PostPosted: Thu Nov 09, 2017 12:31 am
by nageswaragunupudi
Colors with notation like "#rrggbb" can be converted to normal RGB values with this function:
Code: Select all  Expand view
function X2RGB( cClr )

   local r  := HEXTONUM( SubStr( cClr, 2, 2 ) )
   local g  := HEXTONUM( SubStr( cClr, 4, 2 ) )
   local b  := HEXTONUM( SubStr( cClr, 6, 2 ) )

return nRGB( r, g, b )
 


For example, X2RGB( "#4286f4" ) --> 16025154