Quantcast

In Colour.lua: Removed all un-used constants and functions.

James D. Callahan III [03-22-10 - 15:07]
In Colour.lua: Removed all un-used constants and functions.
Filename
Colour.lua
diff --git a/Colour.lua b/Colour.lua
index dc36bbb..d15d153 100644
--- a/Colour.lua
+++ b/Colour.lua
@@ -22,27 +22,21 @@ local addon				= LibStub("AceAddon-3.0"):GetAddon(MODNAME)

 --Colour constants
 local RED	= "ff0000"
---local ORANGE	= "ff7f00"
 local ORANGE	= "ff8040"
 local YELLOW	= "ffff00"
---local GREEN	= "00ff00"
 local GREEN	= "40bf40"
 local WHITE	= "ffffff"
+
 local COPPER	= "eda55f"
 local SILVER	= "c7c7cf"
 local GOLD	= "ffd700"
+
 local PURPLE	= "9980CC"
 local BLUE	= "0000ff"
 local CYAN	= "00ffff"
 local BLACK	= "000000"
 local GREY	= "666666"
---local MIDGREY	= "858585"
 local MIDGREY	= "808080"
-local NEUTRAL	= "bfbfbf"
-local FRIENDLY	= WHITE
-local HONORED	= "00ff00"
-local REVERED	= "3f66e5"
-local EXALTED	= "9933cc"

 local TRAINER	= "d9cb9e"
 local VENDOR	= "aad372"
@@ -51,14 +45,6 @@ local REP	= "ff7c0a"
 local SEASON	= "80590e"
 local MOBDROP	= "ffffc0"

-local POOR	= "919191"
-local COMMON	= WHITE
-local UNCOMMON	= "00A900"
-local RARE	= "0062C3"
-local EPIC	= "B343FF"
-local LEGENDARY	= "FA9900"
-local ARTIFACT	= "e5cc80"
-
 local HIGH	= WHITE
 local NORMAL	= "ffd100"

@@ -67,41 +53,10 @@ local ALLIANCE	= "00ffff"
 ----------------------------------------------------------------------
 --Text colourization functions
 ----------------------------------------------------------------------
-function addon:RGBtoHEX(r,g,b)
-	return string.format("%2x%2x%2x", r*255, g*255, b*255)
-end
-

 -- Changes any string of text to the specified hex colour
 function addon:Colourize(hexColour, text)
-
 	return "|cff" .. tostring(hexColour or 'ffffff') .. tostring(text) .. "|r"
-
-end
-
--- Converts text to Neutral Colour
-function addon:Neutral(text)
-	return self:Colourize(NEUTRAL, text)
-end
-
--- Converts text to Friendly Colour
-function addon:Friendly(text)
-	return self:Colourize(FRIENDLY, text)
-end
-
--- Converts text to Honored Colour
-function addon:Honored(text)
-	return self:Colourize(HONORED, text)
-end
-
--- Converts text to Revered Colour
-function addon:Revered(text)
-	return self:Colourize(REVERED, text)
-end
-
--- Converts text to Exalted Colour
-function addon:Exalted(text)
-	return self:Colourize(EXALTED, text)
 end

 function addon:Horde(text)
@@ -140,53 +95,6 @@ function addon:MobDrop(text)
 	return self:Colourize(MOBDROP, text)
 end

--- Rarity Colors
-function addon:Poor(text)
-	return self:Colourize(POOR, text)
-end
-
-function addon:Common(text)
-	return self:Colourize(COMMON, text)
-end
-
-function addon:Uncommon(text)
-	return self:Colourize(UNCOMMON, text)
-end
-
-function addon:Rare(text)
-	return self:Colourize(RARE, text)
-end
-
-function addon:Epic(text)
-	return self:Colourize(EPIC, text)
-end
-
-function addon:Legendary(text)
-	return self:Colourize(LEGENDARY, text)
-end
-
-function addon:Artifact(text)
-	return self:Colourize(ARTIFACT, text)
-end
-
-function addon:RarityColor(rarityColor, text)
-	if (rarityColor == 1) then
-		return self:Colourize(POOR, text)
-	elseif (rarityColor == 2) then
-		return self:Colourize(COMMON, text)
-	elseif (rarityColor == 3) then
-		return self:Colourize(UNCOMMON, text)
-	elseif (rarityColor == 4) then
-		return self:Colourize(RARE, text)
-	elseif (rarityColor == 5) then
-		return self:Colourize(EPIC, text)
-	elseif (rarityColor == 6) then
-		return self:Colourize(LEGENDARY, text)
-	else
-		return self:Colourize(ARTIFACT, text)
-	end
-end
-
 -- Converts text to Red
 function addon:Red(text)
 	return self:Colourize(RED, text)
@@ -267,48 +175,28 @@ end
 -------------------------------------------------------------------------------
 do
 	local COLOR_NAMES = {
-		["NEUTRAL"]	= "|cff"..NEUTRAL,
-		["FRIENDLY"]	= "|cff"..FRIENDLY,
-		["HONORED"]	= "|cff"..HONORED,
-		["REVERED"]	= "|cff"..REVERED,
-		["EXALTED"]	= "|cff"..EXALTED,
-
-		["TRAINER"]	= "|cff"..TRAINER,
-		["VENDOR"]	= "|cff"..VENDOR,
-		["QUEST"]	= "|cff"..QUEST,
-		["REP"]		= "|cff"..REP,
-		["SEASON"]	= "|cff"..SEASON,
-		["MOBDROP"]	= "|cff"..MOBDROP,
-
-		["POOR"]	= "|cff"..POOR,
-		["COMMON"]	= "|cff"..COMMON,
-		["UNCOMMON"]	= "|cff"..UNCOMMON,
-		["RARE"]	= "|cff"..RARE,
-		["EPIC"]	= "|cff"..EPIC,
-		["LEGENDARY"]	= "|cff"..LEGENDARY,
-		["ARTIFACT"]	= "|cff"..ARTIFACT,
-
-		["HORDE"]	= "|cff"..HORDE,
-		["ALLIANCE"]	= "|cff"..ALLIANCE,
-
-		["BLACK"]	= "|cff"..BLACK,
-		["ORANGE"]	= "|cff"..ORANGE,
-		["GREEN"]	= "|cff"..GREEN,
-		["YELLOW"]	= "|cff"..YELLOW,
-		["GREY"]	= "|cff"..GREY,
-		["MIDGREY"]	= "|cff"..MIDGREY,
-		["RED"]		= "|cff"..RED,
-
-		["HIGH"]	= "|cff"..HIGH,
+		["TRAINER"]	= TRAINER,
+		["VENDOR"]	= VENDOR,
+		["QUEST"]	= QUEST,
+		["REP"]		= REP,
+		["SEASON"]	= SEASON,
+		["MOBDROP"]	= MOBDROP,
+
+		["HORDE"]	= HORDE,
+		["ALLIANCE"]	= ALLIANCE,
+
+		["BLACK"]	= BLACK,
+		["ORANGE"]	= ORANGE,
+		["GREEN"]	= GREEN,
+		["YELLOW"]	= YELLOW,
+		["GREY"]	= GREY,
+		["MIDGREY"]	= MIDGREY,
+		["RED"]		= RED,
+
+		["HIGH"]	= HIGH,
 	}

 	function addon:hexcolor(colorstring)
-		local color = COLOR_NAMES[colorstring]
-
-		if not color then
-			return "|cff"..NORMAL
-		end
-
-		return color
+		return "|cff"..(COLOR_NAMES[colorstring] or NORMAL)
 	end
 end	-- do