darhal Posted April 5, 2015 Author Posted April 5, 2015 (edited) No r, g, b convert it to #FFFFFF smthg like this Edited April 5, 2015 by Guest
darhal Posted April 5, 2015 Author Posted April 5, 2015 Wait i want to convert r g b to hex to use it in a string i want 3 different colors in one string any examples ?
Dimos7 Posted April 5, 2015 Posted April 5, 2015 local hexColor = string.format("#%, 2X%, 2X%, 2X", r, g , b)
WhoAmI Posted April 5, 2015 Posted April 5, 2015 local r,g,b = 255, 0, 0; outputChatBox ( string.format("#%, 2X%, 2X%, 2X", r, g , b) .. "Red string", 255, 255, 255, true );
Et-win Posted April 5, 2015 Posted April 5, 2015 Example: string1 = string.format("%.2X%.2X%.2X", 255, 0, 0).."Red" string2 = string.format("%.2X%.2X%.2X", 0, 255, 0).."Green" string3 = string.format("%.2X%.2X%.2X", 0, 0, 255).."Blue" outputChatBox(string1..", "..string2..", "..string3, 255, 255, 255, true) --Same as: string1 = string.format("%.2X%.2X%.2X", 255, 0, 0) string2 = string.format("%.2X%.2X%.2X", 0, 255, 0) string3 = string.format("%.2X%.2X%.2X", 0, 0, 255) outputChatBox(string1.."Red, "..string2.."Green, "..string3.."Blue", 255, 255, 255, true)
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