Emperor Posted June 7, 2006 Posted June 7, 2006 MsgBox(0, "", RGB(255, 30, 30)) Exit Func RGB($nRed, $nGreen, $nBlue) Return BitOR(BitOR($nRed, BitShift($nGreen, 8)), BitShift($nBlue, 16)) EndFunc The above example should return 1974015, but no matter what I try it always returns the original red value. What am I doing wrong?
Emperor Posted June 7, 2006 Author Posted June 7, 2006 (edited) I think I may have fixed my own problem. I found this website showing a different formula.MsgBox(0, "", RGB(0, 255, 0)) Exit Func RGB($iRed, $iGreen, $iBlue) Return ($iRed * 65536) + ($iGreen * 256) + $iBlue EndFuncThat seems to work, maybe the other formula was for finding out BGR?Anyways I would recommend a function like this to be added to Color.au3, it only makes sence to Edit: Would anyone mind telling me if this formula is correct, I have a hunch my success will be shortlived Edited June 7, 2006 by Emperor
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now