darhal Posted April 5, 2015 Posted April 5, 2015 as the title said how to convert r g b to hex ? thx #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
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 #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
darhal Posted April 5, 2015 Author Posted April 5, 2015 Thx You are the best ever #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Et-win Posted April 5, 2015 Posted April 5, 2015 string.format("%.2X%.2X%.2X", R, G, B) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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 ? #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Dimos7 Posted April 5, 2015 Posted April 5, 2015 local hexColor = string.format("#%, 2X%, 2X%, 2X", r, g , b)
darhal Posted April 5, 2015 Author Posted April 5, 2015 How to use it inside a string ? #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
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) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
darhal Posted April 5, 2015 Author Posted April 5, 2015 Thx a lot #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
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