local E, L, V, P, G = unpack(ElvUI);
local mPlugin = "mMediaTag"
local mMT = E:GetModule(mPlugin);
local addon, ns = ...

--Lua functions
local mInsert = table.insert

local function OptionsTags()
	E.Options.args.mMediaTag.args.tags.args = {
		tagcolor = {
			order = 10,
			type = "group",
			name = L["Colors"],
			args = {
				headertagcolor1 = {
					order = 1,
					type = "header",
					name = L["Class"],
				},
				colorrare = {
					type = 'color',
					order = 2,
					name = "Rare",
					desc = L["Class Colors"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cClassRare
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cClassRare
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
					end,
				},
				colorrarelite = {
					type = 'color',
					order = 3,
					name = "Rare Elite",
					desc = L["Class Colors"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cClassRareElite
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cClassRareElite
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
					end,
				},
				colorelite = {
					type = 'color',
					order = 4,
					name = "Elite",
					desc = L["Class Colors"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cClassElite
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cClassElite
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
						
					end,
				},
				colorboss = {
					type = 'color',
					order = 4,
					name = "Boss",
					desc = L["Class Colors"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cClassBoss
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cClassBoss
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
					end,
				},
				headertagcolor2 = {
					order = 5,
					type = "header",
					name = L["General"],
				},
				colorafk = {
					type = 'color',
					order = 6,
					name = "AFK",
					desc = L["AFK Color"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cGeneralAFK
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cGeneralAFK
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
					end,
				},
				colortank = {
					type = 'color',
					order = 7,
					name = "Tank",
					desc = L["Tank Color"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cGeneralTank
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cGeneralTank
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
					end,
				},
				colorheal = {
					type = 'color',
					order = 8,
					name = "Heal",
					desc = L["Heal Color"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cGeneralHeal
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cGeneralHeal
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
					end,
				},
				colorzzz = {
					type = 'color',
					order = 9,
					name = "Zzz",
					desc = L["Resting Zzz Color"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cGeneralZzz
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cGeneralZzz
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
					end,
				},
				colorlevel = {
					type = 'color',
					order = 10,
					name = "Level ??",
					desc = L["Boss Level ?? Color"],
					hasAlpha = false,
					get = function(info)
						local t = E.db[mPlugin].cGeneralLevel
						return t.r, t.g, t.b
					end,
					set = function(info, r, g, b)
						local t = E.db[mPlugin].cGeneralLevel
						t.r, t.g, t.b, t.color = r, g, b, E:RGBToHex(r, g, b)
					end,
				},
			},
		},
	}
end

mInsert(ns.Config, OptionsTags)