I am reading through the code for Healbot to add the new classes and fix an error. I have found the color codes are listed in 9 digit hex codes as far as I can tell. I have always known about 6 digit hex codes but how do I read and convert the 9 digit codes? The bits I am currently stuck on are below.
They aren't 9 digit codes, they are 8 digit codes with a "|c" in front (for color I presume, there is also a "|r" to reset to previous color).
As for the 8 digits themselves, the first 2 are the alpha value (aka, transparency). 00 being fully transparent and ff being fully opaque. The others are the RGB colors as expected. Therefore, the color code becomes:
|
Source code
|
1
|
|cAARRGGBB
|
where AA is the two hex digit alpha value, RR is the two hex digit red component, GG is the two hex digit green component and BB is the two hex digit blue component.
As an example, try running this little macro:
|
Source code
|
1
|
/run DEFAULT_CHAT_FRAME:AddMessage("This is |cff0000ffblue|r while this is |cff00ff00green|r. The rest is white",1,1,1)
|
This will output most of the message in white except for the words blue and green which will appear in the appropriate color. Note the use of the "|r" in here as well.