Thread Tools Display Modes
11-24-10, 07:17 AM   #1
Lyelu
A Cyclonian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 44
Class Color Taint

Hi,
I notice that some oUF authors are using like this:
Code:
local colors = setmetatable({
	power = setmetatable({
	["MANA"] = {0.36, 0.45, 0.88},
	["RAGE"] = {0.8, 0.21, 0.31},
	["FUEL"] = {0, 0.55, 0.5},
	["FOCUS"] = {0.71, 0.43, 0.27},
	["ENERGY"] = {0.85, 0.83, 0.35},
	["AMMOSLOT"] = {0.8, 0.6, 0},
	["RUNIC_POWER"] = {0, 0.82, 1},
	["POWER_TYPE_STEAM"] = {0.55, 0.57, 0.61},
	["POWER_TYPE_PYRITE"] = {0.60, 0.09, 0.17},
	["HOLY_POWER"] = {0.95, 0.93, 0.15},	
	["SOUL_SHARDS"] = {0.5, 0.0, 0.56},
	}, {__index = oUF.colors.power}),
}, {__index = oUF.colors})
Can I do the same thing with Class Coloring?
I notice that Phanx has written an addon to avoid taint:
http://www.wowinterface.com/download...assColors.html

I'd like to know if it is necessary to use that addon to change the class colors in my oUF, or is it safe to write my own colors inside my oUF layout, as above?

I understand that, if the user has the ClassColors addon installed, it will overwrite my colors... but I just wanted to make the shaman blue darker so it's not the same color as the mana bar. Then it will be ok if user also wants to install the other mod, but if not, then I just wanted to change that one color (I know it sounds obsessive but it's a very special request from my sweetheart).

Thanks!
  Reply With Quote
11-24-10, 08:32 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
The code you pasted is used to modify colors in our layout, without forcing those changes onto other layouts. It's basically just a "Play nice with other layouts"-proxy.

oUF also does support !ClassColors, so changing the color there will make oUF pick it up and update, as long as they aren't using the proxy method (above).

You won't get any taint modifying the colors directly. I cache them all at init, to prevent people from causing taint that way.

The way overriding color works is pretty much:
oUF layout .colors -> (!ClassColors -> oUF internal colors)
__________________
「貴方は1人じゃないよ」
  Reply With Quote
11-24-10, 10:05 PM   #3
Lyelu
A Cyclonian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 44
Thanks, haste.

I edited the colors as little as possible, but made it so the power bars are not the same color as class-colored health bars.

My solution, in case anyone's looking:

Code:
oUF.colors.power['RUNIC_POWER'] = {.5, .1, .7}
oUF.colors.power['MANA'] = {.48, .9, 1}
oUF.colors.power['ENERGY'] = {1, 1, .5}
oUF.colors.power['FOCUS'] = {.72, .95, .72}
if not (IsAddOnLoaded'!ClassColors') then
	oUF.colors.class['SHAMAN'] = {0, .3, .53}
	oUF.colors.class['ROGUE'] = {.52, .52, 0}
	oUF.colors.class['MAGE'] = {0, .52, .65}
	oUF.colors.class['HUNTER'] = {0, .6, .1}
end
I think that should be safe, just to check if it's loaded or not before loading my colors. Works just fine. This way I don't overwrite that addon if someone has it on.

The code that I posted first is a little different, but says the same thing, right? Both ways ok?
  Reply With Quote
11-25-10, 02:52 PM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Both work yes. The first solution plays nice with other layouts by not enforcing colors outside it, while the above solution forces all layouts to use the colors unless they define their own.
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Class Color Taint


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