xXMADEXx Posted January 12, 2014 Share Posted January 12, 2014 Hi guys. Is there a way to get an RGB color, after it gets converted in tocolor? so something like this: local colors = { 255, 255, 255, 255 } local c = tocolor ( unpack ( colors ) ) -- some function to convert "c" back to RGB Link to comment
arezu Posted January 12, 2014 Share Posted January 12, 2014 local color = tocolor(255, 255, 255, 255) local red = bitExtract(color, 0, local green = bitExtract(color, 8, local blue = bitExtract(color, 16, local alpha = bitExtract(color, 24, (I couldn't use lua tag, because the text got formatted wrong because of '8)') Link to comment
50p Posted January 12, 2014 Share Posted January 12, 2014 local color = tocolor(255, 255, 255, 255) local red = bitExtract(color, 0, 8) local green = bitExtract(color, 8, 8) local blue = bitExtract(color, 16, 8) local alpha = bitExtract(color, 24, 8) (I couldn't use lua tag, because the text got formatted wrong because of '8)') Link to comment
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