יחידה:TypeToColor

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:TypeToColor/תיעוד

local p = {}

function p.convert( frame )
	return p.convertImpl(frame.args[1])
end

function p.convertImpl(type)
	local types = {
		['do'] = '808080',
		['פעילויות'] = '808080',
		around = '800080',
		['קניות'] = '008080',
		buy = '008080',
		['בידור'] = '800000',
		city = '0000FF',
		['שתייה'] = '000000',
		drink = '000000',
		['אוכל'] = 'D2691E',
		eat = 'D2691E',
		go = 'A52A2A',
		['רשימה'] = '228B22',
		['רשומה'] = '228B22',
		listing = '228B22',
		other = '228B22',
		['מוקדי העניין העיקריים'] = '4682B4',
		['מוקדי'] = '4682B4',
		see = '4682B4',
		['לינה'] = '000080',
		sleep = '000080',
		vicinity = '800000',
		view = '4169E1',
		feature = '#ffcba8',
		['יעדים מרכזיים'] = '#0ea2f1',
		['היישובים העיקריים'] = '0000FF',
	}

	local result = types[type]
	if result then
		return result
	end
	
	-- Deprecated usage - trace it
	types = {
		black = '000000',
		blue = '0000FF',
		brown = 'A52A2A',
		chocolate = 'D2691E',
		forestgreen = '228B22',
		gold = 'FFD700',
		gray = '808080',
		grey = '808080',
		lime = '00FF00',
		magenta = 'FF00FF',
		maroon = '800000',
		mediumaquamarine = '66CDAA',
		navy = '000080',
		orange = 'FFA500',
		plum = 'DDA0DD',
		purple = '800080',
		red = 'FF0000',
		royalblue = '4169E1',
		silver = 'C0C0C0',
		steelblue = '4682B4',
		teal = '008080',
	}

	local result = types[type]
	if result then
		return result --  .. '[[category:Fixme TypeToColor]]'
	end

	return 'C0C0C0' -- .. '[[category:Fixme TypeToColor Unknown]]'
end

return p