Wikia

WoWWiki

RGBToHex

Talk0
98,452pages on
this wiki
This is a user-defined function that you can copy and paste into your addon. Replace <PREFIX> with your AddOn's prefix to avoid conflicts between different versions of these functions.


Takes a RGB value set (0-255) and converts it into a hex string.

local function RGBToHex(r, g, b)
	r = r <= 255 and r >= 0 and r or 0
	g = g <= 255 and g >= 0 and g or 0
	b = b <= 255 and b >= 0 and b or 0
	return string.format("%02x%02x%02x", r, g, b)
end
Advertisement | Your ad here

Photos

Add a Photo
61,966photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki