Difference between revisions of "API rgbtohex"

From Vendetta Lua
Jump to: navigation, search
(split)
 
(No difference)

Latest revision as of 22:06, 25 January 2009

rgbtohex

Definition:
rgbtohex(string deccolor) -> string hexcolor
Description:
Returns string containing escaped hexadecimal version of the in decimal given color
Arguments:
deccolor string with color in decimal format (format: "r g b")
Returns:
hexcolor string starting with ascii code 127 followed by the color in hexadecimal format. (format: '\127RRGGBB') on failure it returns your input value
Example:
The following prints "hi!" in red to the chat area. The by rgbtohex() returned string is the equivalent of "\127ff0000"

print(rgbtohex("255 0 0").."hi!")