FUNCTION getColorHex LPARAMETERS pnColor && The integer from getcolor() lcHex = right(transform(pnColor, "@0"), 6) && That is a zero after the @ RETURN right(lcHex, 2)+substr(lcHex,3,2)+left(lcHex,2) && Change order from BGR to RGB ENDFUNC