Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created August 10, 2014 05:56
Show Gist options
  • Save nefftd/2abf4cc45cbe6f4695da to your computer and use it in GitHub Desktop.
Save nefftd/2abf4cc45cbe6f4695da to your computer and use it in GitHub Desktop.
-- Credit and thanks to Tidy Plates for this.
local function classcolor(r,g,b)
r,g,b = floor(r*100+.5),floor(g*100+.5),floor(b*100+.5)
return ('%03d%03d%03d'):format(r,g,b)
end
local classes = {}
for class,color in pairs(RAID_CLASS_COLORS) do
classes[classcolor(color.r,color.g,color.b)] = class
end
classes['000100060'] = 'MONK' -- Rounding error on Blizz's part.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment