haste/oUF — pull request #111 by Rainrider (2011-12-20 12:58:54+00:00)
Title: Easier fallback colors for power

The PowerBarColors table contains numerically indexed entries as a fallback for when there is not an entry for the corresponding powerToken. Currently oUF's power element only copies the powerToken entries into oUF.colors.power and relies on the altR, altG and altB return values of UnitPowerType for a fallback and thus requires layout authors to include all POWER_TYPE_* from FrameXML/ClobalStrings.lua if they want custom coloring for the power bar. It would be easier in my optinion if we could provide a fallback by powerType as it is done in FrameXML/UnitFrame.lua as so we don't have to look into FrameXML/ClobalStrings.lua every patch for new POWER_TYPE_* entries.

This patch allows for such a fallback. I left the altR, altG, altB case in if ptype is nil as I don't know if it always returns something for alternative power types.