Quantcast

added coloring options

failcoder [07-27-15 - 20:17]
added coloring options
Filename
SVUI_!Core/system/media.lua
SVUI_!Core/xml/styles.xml
SVUI_!Options/SVUI_!Options.lua
diff --git a/SVUI_!Core/system/media.lua b/SVUI_!Core/system/media.lua
index 147fb16..98947af 100644
--- a/SVUI_!Core/system/media.lua
+++ b/SVUI_!Core/system/media.lua
@@ -282,9 +282,10 @@ do
 			["checkbox"] 	= [[Interface\AddOns\SVUI_!Core\assets\borders\DEFAULT]],
 		},
 		["color"] = {
-			["default"]     = {0.2, 0.2, 0.2, 1},
+			["default"]     = {0.15, 0.15, 0.15, 1},
+			["secondary"]   = {0.2, 0.2, 0.2, 1},
 			["button"]      = {0.2, 0.2, 0.2, 1},
-			["special"]     = {.37, .32, .29, 1},
+			["special"]     = {0.37, 0.32, 0.29, 1},
 			["specialdark"] = {.23, .22, .21, 1},
 			["unique"]      = {0.32, 0.258, 0.21, 1},
 			["dusty"]   		= {.28, .27, .26, 1},
@@ -316,6 +317,7 @@ do
 		},
 		["gradient"]  = {
 			["default"]   	= {"VERTICAL", 0.08, 0.08, 0.08, 0.22, 0.22, 0.22},
+			["secondary"]  	= {"VERTICAL", 0.08, 0.08, 0.08, 0.22, 0.22, 0.22},
 			["special"]   	= {"VERTICAL", 0.33, 0.25, 0.13, 0.47, 0.39, 0.27},
 			["specialdark"] = {"VERTICAL", 0.23, 0.15, 0.03, 0.33, 0.25, 0.13},
 			["dusty"] 		= {"VERTICAL", 0.12, 0.11, 0.1, 0.22, 0.21, 0.2},
@@ -1102,9 +1104,11 @@ function SV:UpdateSharedMedia()
 		end
 	end

-	local special = self.media.color.special
 	local default = self.media.color.default
-	self.media.gradient.special = {"VERTICAL",special[1], special[2], special[3], default[1], default[2], default[3]}
+	self.media.gradient.default = {"VERTICAL", default[1]*.25, default[2]*.25, default[3]*.25, default[1], default[2], default[3]}
+
+	local secondary = self.media.color.secondary
+	self.media.gradient.secondary = {"VERTICAL", secondary[1]*.25, secondary[2]*.25, secondary[3]*.25, secondary[1], secondary[2], secondary[3]}

 	local cColor1 = CUSTOM_CLASS_COLORS[classToken]
 	local cColor2 = RAID_CLASS_COLORS[classToken]
@@ -1121,6 +1125,11 @@ function SV:UpdateSharedMedia()
 	self.media.gradient.class = {"VERTICAL", r2, g2, b2, r1, g1, b1}
 	self.media.gradient.bizzaro = {"VERTICAL", ir2, ig2, ib2, ir1, ig1, ib1}

+	local special = self.media.color.special
+	self.media.gradient.special = {"VERTICAL", special[1], special[2], special[3], r1, g1, b1}
+	-- self.media.gradient.special = {"VERTICAL", special[1]*.25, special[2]*.25, special[3]*.25, special[1], special[2], special[3]}
+	-- self.media.gradient.special = {"VERTICAL",special[1], special[2], special[3], default[1], default[2], default[3]}
+
 	self.Events:Trigger("SHARED_MEDIA_UPDATED");
 	if(not InCombatLockdown()) then
 		collectgarbage("collect");
diff --git a/SVUI_!Core/xml/styles.xml b/SVUI_!Core/xml/styles.xml
index f06f1c3..d2d3549 100644
--- a/SVUI_!Core/xml/styles.xml
+++ b/SVUI_!Core/xml/styles.xml
@@ -348,8 +348,8 @@
         <Attributes>
             <Attribute name="panelID" type="string" value="pattern" />
             <Attribute name="panelPadding" type="number" value="1" />
-            <Attribute name="panelColor" type="string" value="special" />
-            <Attribute name="panelGradient" type="string" value="special" />
+            <Attribute name="panelColor" type="string" value="secondary" />
+            <Attribute name="panelGradient" type="string" value="secondary" />
             <Attribute name="panelTexUpdate" type="boolean" value="false" />
             <Attribute name="panelSkipUpdate" type="boolean" value="false" />
         </Attributes>
@@ -369,8 +369,8 @@
         <Attributes>
             <Attribute name="panelID" type="string" value="premium" />
             <Attribute name="panelPadding" type="number" value="1" />
-            <Attribute name="panelColor" type="string" value="class" />
-            <Attribute name="panelGradient" type="boolean" value="class" />
+            <Attribute name="panelColor" type="string" value="special" />
+            <Attribute name="panelGradient" type="boolean" value="special" />
             <Attribute name="panelTexUpdate" type="boolean" value="false" />
             <Attribute name="panelSkipUpdate" type="boolean" value="false" />
         </Attributes>
@@ -390,8 +390,8 @@
         <Attributes>
             <Attribute name="panelID" type="string" value="model" />
             <Attribute name="panelPadding" type="number" value="1" />
-            <Attribute name="panelColor" type="string" value="class" />
-            <Attribute name="panelGradient" type="boolean" value="class" />
+            <Attribute name="panelColor" type="string" value="special" />
+            <Attribute name="panelGradient" type="boolean" value="special" />
             <Attribute name="panelTexUpdate" type="boolean" value="false" />
             <Attribute name="panelSkipUpdate" type="boolean" value="false" />
             <Attribute name="panelOffset" type="number" value="0" />
diff --git a/SVUI_!Options/SVUI_!Options.lua b/SVUI_!Options/SVUI_!Options.lua
index b63ba9e..ad5a79b 100644
--- a/SVUI_!Options/SVUI_!Options.lua
+++ b/SVUI_!Options/SVUI_!Options.lua
@@ -608,7 +608,7 @@ SV.Options.args.Core.args.mostCommon = {
 				default = {
 					type = "color",
 					order = 2,
-					name = L["Default Color"],
+					name = L["Primary Color"],
 					desc = L["Main color used by most UI elements. (ex: Backdrop Color)"],
 					hasAlpha = true,
 					get = function(key)
@@ -620,9 +620,24 @@ SV.Options.args.Core.args.mostCommon = {
 						SV:UpdateSharedMedia()
 					end,
 				},
-				special = {
+				secondary = {
 					type = "color",
 					order = 3,
+					name = L["Secondary Color"],
+					desc = L["Color used as contrast in multi-colored frames."],
+					hasAlpha = true,
+					get = function(key)
+						local color = SV.media.color.secondary
+						return color[1],color[2],color[3],color[4]
+					end,
+					set = function(key, rValue, gValue, bValue, aValue)
+						SV.media.color.secondary = {rValue, gValue, bValue, aValue}
+						SV:UpdateSharedMedia()
+					end,
+				},
+				special = {
+					type = "color",
+					order = 4,
 					name = L["Accent Color"],
 					desc = L["Color used in various frame accents.  (ex: Dressing Room Backdrop Color)"],
 					hasAlpha = true,
@@ -638,11 +653,12 @@ SV.Options.args.Core.args.mostCommon = {
 				},
 				resetbutton = {
 					type = "execute",
-					order = 4,
+					order = 5,
 					name = L["Restore Defaults"],
 					func = function()
 						SV.media.color.default = {0.15, 0.15, 0.15, 1};
-						SV.media.color.special = {0.4, 0.32, 0.2, 1};
+						SV.media.color.secondary = {0.2, 0.2, 0.2, 1};
+						SV.media.color.special = {0.37, 0.32, 0.29, 1};
 						SV:UpdateSharedMedia()
 					end
 				}