Jump to content

From R G B to Hex ?


darhal

Recommended Posts

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) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...