Hello,
is there a function to change the color HEX value to an INT value.
Thank you in advance
Otto
FUNCTION RgbToRgbHex( nColorRgb )
local cRgbHex := ""
cRgbHex += "#"
cRgbHex += NumToHex( nRgbRed( nColorRgb ), 2 )
cRgbHex += NumToHex( nRgbGreen( nColorRgb ), 2 )
cRgbHex += NumToHex( nRgbBlue( nColorRgb ), 2 )
RETURN cRgbHex
FUNCTION RGB_TO_HTML(f_nColor)
Local cColorReturn := "#", aTmpRGB := {}
aadd(aTmpRGB,decToHex(nRGBRed(f_nColor)))
aadd(aTmpRGB,decToHex(nRGBgreen(f_nColor)))
aadd(aTmpRGB,decToHex(nRGBBlue(f_nColor)))
If Len(aTmpRGB[1]) == 1
aTmpRGB[1] := "0"+aTmpRGB[1]
EndIf
If Len(aTmpRGB[2]) == 1
aTmpRGB[2] := "0"+aTmpRGB[2]
EndIf
If Len(aTmpRGB[3]) == 1
aTmpRGB[3] := "0"+aTmpRGB[3]
EndIf
cColorReturn += (aTmpRGB[1]+aTmpRGB[2]+aTmpRGB[3])
Return cColorReturn
Do I only have to convert "BBGGRR" to "#RRGGBB"
function CLRTOHTML( nClr )
local cHex := LOWER( NUMTOHEX( nClr, 6 ) )
return "#" + RIGHT( cHex, 2 ) + SUBSTR( cHex, 3, 2 ) + LEFT( cHex, 2 )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Rick Lipkin and 58 guests