Can I use a hex color sample 0xFFFF00
How I can converte it into rgb color ?
function cHex2aRgb( cHexColor )
local nR,nG,nB
local aRgb
if left(cHexColor,1) == "#"
cHexColor := substr(cHexColor,2,len(cHexColor) )
endif
if len(cHexColor) == 3
nR = ft_Hex2Dec( substr(cHexColor,1,1))
nG = ft_Hex2Dec( substr(cHexColor,2,1))
nB = ft_Hex2Dec( substr(cHexColor,3,1))
else
nR = ft_Hex2Dec( substr(cHexColor,1,2))
nG = ft_Hex2Dec( substr(cHexColor,3,2))
nB = ft_Hex2Dec( substr(cHexColor,5,2))
endif
aRgb := {nR, nG, nB }
return aRgb; // returns an array with the rgb values
Silvio.Falconi wrote:Can I use a hex color sample 0xFFFF00
How I can converte it into rgb color ?
DEFINE WINDOW oWnd FROM 0, 0 TO 100, 100 PIXEL TITLE "My color test" COLORS 0, 0x00FFFF
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 75 guests