MIKI785 Posted December 16, 2011 Share Posted December 16, 2011 Hello, It's a little bit stupid question but how to convert HEX code (like #FF0000) To RGB format? (red- 250, 0, 0) I didn't find answer and I don't think it's too difficult to answer.. thanks. Link to comment
Castillo Posted December 16, 2011 Share Posted December 16, 2011 function hex2rgb(hex) hex = hex:gsub("#","") return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6)) end Code is not mine, Aiboforcen wrote it. Link to comment
MIKI785 Posted December 16, 2011 Author Share Posted December 16, 2011 Quick answer, thx. 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