MIKI785 Posted December 16, 2011 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. Lua Scripter Owner of mshost.cz MTA portal.
Castillo Posted December 16, 2011 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
MIKI785 Posted December 16, 2011 Author Posted December 16, 2011 Quick answer, thx. Lua Scripter Owner of mshost.cz MTA portal.
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