Candy Crush Saga Fanon Wiki
Advertisement

Documentation for this module may be created at Module:DifficultyColor/doc

-- Coded by [[User:Catinthedark]] in Candy Crush Saga Wiki

local p = {}
 
local color = {
	["None"] = {'#000000', '#FFFFFF'},
	["Extremely Easy"] = {'#FFFFFF', '#00A2E8'},
	["Very Easy"] = {'#000000', '#00FFFF'},
	["Easy"] = {'#FFFFFF', '#008080'},
	["Somewhat Easy"] = {'#FFFFFF', '#00C000'}, -- Somewhat Easy = Considerably Easy
	["Considerably Easy"] = {'#FFFFFF', '#00C000'}, -- Somewhat Easy = Considerably Easy
	["Medium"] = {'#000000', '#FFC800'},
	["Somewhat Hard"] = {'#000000', '#FF8000'}, -- Somewhat Hard = Considerably Hard
	["Considerably Hard"] = {'#000000', '#FF8800'}, -- Somewhat Hard = Considerably Hard
	["Hard"] = {'#FFFFFF', '#FF0000'},
	["Very Hard"] = {'#FFFFFF', '#800000'},
	["Extremely Hard"] = {'#FFFFFF', '#000000'}, -- Extremely Hard = Insanely Hard
	["Insanely Hard"] = {'#FFFFFF', '#000000'}, -- Extremely Hard = Insanely Hard
	["Nearly Impossible"] = {'#FFFFFF', '#191970'},
	["Impossible"] = {'#FF0000', '#696969'},
	["Variable"] = {'#FFFFFF', '#9000A8'}
}
 
local function _getColor( difficulty, forecolor )
 
	local i = 2
	local myColor = ''
 
	if forecolor then i = 1 end
	myColor = color[difficulty]
 
	if myColor then
	    return myColor[i]
	else
	    return ''
	end
end
 
function p.getColor( frame )
    local a = frame.args
    local difficulty = a[1] -- mixed case difficulty, eg. "Very Hard"
    local forecolor = a[2] and not (a[2] == '') -- if second param present, get forecolor, else backcolor
 
	return _getColor(difficulty, forecolor)
end
 
return p
Advertisement