lnRGBColor = RGB(64,128,255)
loColor = Color2Html(lnRGBColor)
? lnRGBColor, loColor.cHTMLcolor
? loColor.nR, loColor.nG, loColor.nB
RETURN
* Converts color number to HTML color format
FUNCTION Color2Html
LPARAMETERS tnColor
LOCAL loColor
loColor = CREATEOBJECT("Empty")
ADDPROPERTY(loColor, "nR", BITAND(tnColor, 0xFF))
ADDPROPERTY(loColor, "nG", BITAND(BITRSHIFT(tnColor, 8), 0xFF))
ADDPROPERTY(loColor, "nB", BITAND(BITRSHIFT(tnColor, 16), 0xFF))
ADDPROPERTY(loColor, "cHTMLcolor", STRTRAN("#" + ;
TRANSFORM(loColor.nR, "@0") + ;
TRANSFORM(loColor.nG, "@0") + ;
TRANSFORM(loColor.nB, "@0"), "0x000000", "" ))
RETURN loColor
Niciun comentariu:
Trimiteți un comentariu