Dota 2 Вики
@DeletedUser41170185 (обсуждение | вклад)
Нет описания правки
мНет описания правки
Строка 1: Строка 1:
  +
local getArgs = require( 'Module:Arguments' ).main
 
local p = {}
 
local p = {}
  +
dict = {
 
color_dict = {
 
 
-- GENERAL WIKI COLORS
 
-- GENERAL WIKI COLORS
 
["wiki1"] = "#B44335",
 
["wiki1"] = "#B44335",
Строка 117: Строка 117:
 
["staydown"] = "#FDA",
 
["staydown"] = "#FDA",
 
["drop"] = "#FCC",
 
["drop"] = "#FCC",
["down"] = "#FCC",
+
["down"] = "#FCC"
 
}
 
}
  +
 
 
function p.main( frame )
 
function p.main( frame )
  +
local args = getArgs()
local color_input = frame:callParserFunction{ name = 'lc', args = { frame.args[1] } }
 
  +
return p._main( args )
local color_output = color_dict[color_input]
 
 
end
   
  +
function p._main( args )
if color_output == nil then
 
  +
if args[1] then
color_output = color_input
 
  +
local lc_input = string.lower( args[1] )
end
 
  +
local output = dict[lc_input]
 
 
if output == nil then
return color_output
 
  +
output = lc_input
  +
end
 
  +
return output
  +
else
  +
return ''
  +
end
 
end
 
end
  +
 
 
return p
 
return p

Версия от 20:54, 6 марта 2018

Документация для Модуль:Color Перейти к коду ↴ [ править | очистить ]

Reality Rift icon
▶️ Planeshift.
Документацию для этого шаблона или модуля можно найти в Template:Color.
Вы можете быть перенаправлены на другой язык вики, если перевод недоступен.


local getArgs = require( 'Module:Arguments' ).main
local p = {}
dict = {
	-- GENERAL WIKI COLORS
	["wiki1"] = "#B44335",
	["wiki2"] = "#CD5F51",
	["wiki3"] = "#FFAEA3",
	["wiki4"] = "#FDE6E3",
	["wiki5"] = "#E4C62E",
	["wiki6"] = "#E38800",
	-- DOTA 2 UI
	["ui1"] = "#1B1E21",
	["ui2"] = "#2F363D",
	-- HEROES
	["strength"] = "#B9500B",
	["agility"] = "#167C13 ",
	["intelligence"] = "#257DAE",
	["сила"] = "#B9500B",
	["ловкость"] = "#167C13",
	["интеллект"] = "#257DAE",
	["radiant"] = "#598307",
	["свет"] = "#598307",
	["dire"] = "#A83806",
	["тьма"] = "#A83806",
	["neutral"] = "#434137",
	-- UNITS
	["creep"] = "#2277AA",
	["крип"] = "#2277AA",
	["creep-hero"] = "#FFBE66",
	["крип-герой"] = "#FFBE66",
	["lane creep"] = "#2277AA",
	["линейный крип"] = "#2277AA",
	["jungle creep"] = "#2277AA",
	["лесной крип"] = "#2277AA",
	["ancient creep"] = "#2277AA",
	["древний крип"] = "#2277AA",
	["summon"] = "#FFBE66",
	["призываемое существо"] = "#FFBE66",
	["ward"] = "#64D74A",
	["вард"] = "#64D74A",
	["building"] = "#2277AA",
	["строение"] = "#2277AA",
	["other"] = "pink",
	["другое"] = "pink",
	["courier"] = "#FFBE66",
	["курьер"] = "#FFBE66",
	-- ABILITIES
	["hero"] = "#B44335",
	["герой"] = "#B44335",
	["ultimate"] = "#414141",
	["ульт"] = "#414141",
	["item"] = "#227722",
	["предмет"] = "#227722",
	["npc"] = "#2277AA",
	["нип"] = "#2277AA",
	["aghanims"] = "#5B388F",
	["talent"] = "#BDB76B",
	["талант"] = "#BDB76B",
	-- ITEMS
	["gold"] = "#DAA520",
	["золото"] = "#DAA520",
	["armor"] = "#B911FC",
	["броня"] = "#B911FC",
	["caster"] = "#1A88FC",
	["магия"] = "#1A88FC",
	["support"] = "#1A88FC",
	["поддержка"] = "#1A88FC",
	["artifacts"] = "#DB9702",
	["артефакты"] = "#DB9702",
	["common"] = "#2BAC00",
	["общее"] = "#2BAC00",
	["basic"] = "#FEFEFE",
	["attributes"] = "#FEFEFE",
	["атрибуты"] = "#FEFEFE",
	["armaments"] = "#FEFEFE",
	["вооружение"] = "#FEFEFE",
	["arcane"] = "#FEFEFE",
	["мистика"] = "#FEFEFE",
	-- COSMETIC ITEMS - RARITY
	["cos_common"] = "#b0c3d9",
	["cos_uncommon"] = "#5e98d9",
	["cos_rare"] = "#4b69ff",
	["cos_mythical"] = "#8847ff",
	["cos_legendary"] = "#d32ce6",
	["cos_ancient"] = "#eb4b4b",
	["cos_immortal"] = "#b28a33",
	["cos_arcana"] = "#ade55c",
	["cos_seasonal"] = "#FFF34F",
	-- COSMETIC ITEMS - QUALITY
	["cos_normal"] = "#B2B2B2",
	["cos_genuine"] = "#4D7455",
	["cos_elder"] = "#476291", -- Internal name: vintage
	["cos_unusual"] = "#8650AC",
	["cos_unique"] = "#D2D2D2",
	["cos_community"] = "#70B04A",
	["cos_developer"] = "#A50F79",
	["cos_selfmade"] = "#70B04A",
	["cos_customized"] = "#00FF00",
	["cos_inscribed"] = "#CF6A32", -- Internal name: strange
	["cos_completed"] = "#8650AC",
	["cos_cursed"] = "#8650AC",
	["cos_heroic"] = "#8650AC", -- Internal name: tournament
	["cos_favored"] = "#FFFF00",
	["cos_ascendant"] = "#EB4B4B",
	["cos_autographed"] = "#ADE55C",
	["cos_legacy"] = "#FFFFFF",
	["cos_exalted"] = "#CCCCCC",
	["cos_frozen"] = "#4682B4",
	["cos_corrupted"] = "#A52A2A",
	["cos_auspicious"] = "#32CD32", -- Internal name: lucky
	["cos_unusual_text"] = "#e4ae39",
	-- RANKINGS
	["proceed"] = "#CFC",
	["up"] = "#CFC",
	["stayup"] = "#EFA",
	["stay"] = "#FF9",
	["staydown"] = "#FDA",
	["drop"] = "#FCC",
	["down"] = "#FCC"
}

function p.main( frame )
	local args = getArgs()
	return p._main( args )
end

function p._main( args )
	if args[1] then
		local lc_input = string.lower( args[1] )
		local output = dict[lc_input]
		if output == nil then 
			output = lc_input
		end
	
		return output
	else
		return ''
	end
end

return p