Thread Tools Display Modes
07-16-12, 12:31 AM   #1
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
HEX_CLASS_COLORS removed?

Idk if it was JUST this last patch (15851) but HEX_CLASS_COLORS is now returning nils and instead is replaced by RAID_CLASS_COLORS[class].colorStr which now contains the hex + 'ff' in the front.

Was this just a recent change? Or has this been like this since MoP beta was available?

Lua Code:
  1. RAID_CLASS_COLORS = {
  2.     ["HUNTER"] = { r = 0.67, g = 0.83, b = 0.45, colorStr = "ffabd473" },
  3.     ["WARLOCK"] = { r = 0.58, g = 0.51, b = 0.79, colorStr = "ff9482c9" },
  4.     ["PRIEST"] = { r = 1.0, g = 1.0, b = 1.0, colorStr = "ffffffff" },
  5.     ["PALADIN"] = { r = 0.96, g = 0.55, b = 0.73, colorStr = "fff58cba" },
  6.     ["MAGE"] = { r = 0.41, g = 0.8, b = 0.94, colorStr = "ff69ccf0" },
  7.     ["ROGUE"] = { r = 1.0, g = 0.96, b = 0.41, colorStr = "fffff569" },
  8.     ["DRUID"] = { r = 1.0, g = 0.49, b = 0.04, colorStr = "ffff7d0a" },
  9.     ["SHAMAN"] = { r = 0.0, g = 0.44, b = 0.87, colorStr = "ff0070de" },
  10.     ["WARRIOR"] = { r = 0.78, g = 0.61, b = 0.43, colorStr = "ffc79c6e" },
  11.     ["DEATHKNIGHT"] = { r = 0.77, g = 0.12 , b = 0.23, colorStr = "ffc41f3b" },
  12.     ["MONK"] = { r = 0.0, g = 1.00 , b = 0.59, colorStr = "ff00ff96" },
  13. };

Edit: I am a baboon and I completely forgot I made that a global table for my own addon >.> just forgot to include monk.

Last edited by suicidalkatt : 07-16-12 at 12:49 AM.
 
07-16-12, 12:51 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The colorStr keys have been part of RAID_CLASS_COLORS at least since they enabled addons in the MoP beta, in case anyone was wondering.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
07-16-12, 01:06 AM   #3
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Phanx View Post
The colorStr keys have been part of RAID_CLASS_COLORS at least since they enabled addons in the MoP beta, in case anyone was wondering.
What would be the best way to easily create a table for just the hex values of those strings, i.e. just clip the 'ff' off at the start?

Lua Code:
  1. HEX_CLASS_COLORS = {};
  2. for i=1,#CLASS_SORT_ORDER do
  3.     local str = RAID_CLASS_COLORS[CLASS_SORT_ORDER[i]].colorStr;
  4.     local str = -- Do action here that changes str to correct str;
  5.     HEX_CLASS_COLORS[CLASS_SORT_ORDER[i]] = str;
  6. end

edit: local str = gsub(str,"(ff)","",1)

seems to do the trick.

Last edited by suicidalkatt : 07-16-12 at 01:14 AM.
 
07-16-12, 04:34 AM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
That works, although I'm not sure why you would want to use an indexed table based on Blizzard's arbitrary and unintuitive CLASS_SORT_ORDER values, instead of a hash table with class/color pairs.

On a marginally related note, the MoP betas for !ClassColors support the colorStr key, so if your addon supports that you can read the values from there... and if your addon doesn't support it, it should.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
07-16-12, 06:29 AM   #5
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
I don't think you need to use CLASS_SORT_ORDER, the order isn't even based on the real class ID's or anything, hehe. I'd just use something like:

Code:
HEX_CLASS_COLORS = {}
do
  for k, v in pairs(RAID_CLASS_COLORS) do
    HEX_CLASS_COLORS[k] = v.colorStr:sub(3)
  end
end
Not sure if I contributed much, hehe. :P
 
07-17-12, 04:48 PM   #6
Farmbuyer
A Cyclonian
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 43
Originally Posted by Phanx View Post
That works, although I'm not sure why you would want to use an indexed table based on Blizzard's arbitrary and unintuitive CLASS_SORT_ORDER values, instead of a hash table with class/color pairs.
My Hobby: re-sorting CLASS_SORT_ORDER to be alphabetical, with makes 70% of addons list their class-related things in a nice alphabetical intuitive way, and the remaining 30% puke horribly because of poor assumptions.

As for RAID_CLASS_COLORS, it looks like they adopted their (smart) current idea of "ITEM_QUALITY_COLORS[n].hex", but called the field "colorStr" instead of "hex". But colorStr includes the leading "ff" value, where "hex" includes the entire "|cff" escape-sequence-plus-ff value.

(Curious: Is "colorStr" ever used in Blizzard's code without unconditionally prefixing the |c escape? Brief investigation says not. Maybe they plan to do other things with it.)
 
07-17-12, 05:20 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Farmbuyer View Post
(Curious: Is "colorStr" ever used in Blizzard's code without unconditionally prefixing the |c escape? Brief investigation says not. Maybe they plan to do other things with it.)
Well, as far as I know the only use for color hex strings in WoW is with the "|c" escape... and the leading "ff" is only relevant in that case. My guess would be that whoever was adding the values to the table just didn't think very thoroughly about what the values would be used for. Otherwise, they'd have either included the "|c" escape in the values, or left off the leading "ff". Preferrably the latter.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
07-18-12, 05:31 AM   #8
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Isn't the leading ff supposed to be alpha channel? If anything, hehe.
 
07-18-12, 05:58 AM   #9
eiszeit
A Chromatic Dragonspawn
 
eiszeit's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 154
It is, I guess.
__________________
Lyn • I'm a mess of unfinished thoughts
 
07-18-12, 02:52 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
It is, but it's not specific to the individual color, and it is specific to the |c escape sequence, so it shouldn't really be included in the table values.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
07-19-12, 02:16 AM   #11
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
The leading FF or 00 are non-functional. I guess they added it to go from 24bit to 32bit (24bit RGB color with 8bit alpha channel) but currently it has no effect. Where do you need hex colors? Strings only right. For those you need all the 8 characters.

Maybe they plan on adding text alpha channels? If that's true everyone with 00 leading a color string will get invisibile text strings.
*Mark for myself*...check the text strings and swap leading 00 with FF.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 07-19-12 at 02:20 AM.
 
07-19-12, 01:47 PM   #12
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I feel like I've changed those before myself... iirc, it changed the saturation, not the alpha. But I could be misremembering...
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

 
 

WoWInterface » Site Forums » Archived Beta Forums » MoP Beta archived threads » HEX_CLASS_COLORS removed?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off