FANDOM


--[[----------------------------------------------------------------------------
	Module:Color
		For documentation, see Template:Color
----------------------------------------------------------------------------]]--
local p = {}
 
local COLORS = mw.loadData('Module:Color/data')
 
local function getColor(str)
	if not str or type(str) ~= 'string' or str == '' then return end
	return COLORS[str] or str
end
 
function p.main(frame)
	if not frame then error('Color.main: No frame found') end
	local fgcol = getColor(frame.args[1])
	local str = frame.args[2]
	local bgcol = getColor(frame.args[3])
	local glow = getColor(frame.args.glow)
	if not str then return '' end
	local span = mw.html.create('span'):wikitext(str)
	if fgcol then span:css('color', fgcol) end
	if bgcol then span:css('background-color', bgcol) end
	if glow then span:css('text-shadow', '0 0 8px ' .. glow) end
	return span
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.