<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindpowe.red/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASports_color</id>
	<title>Module:Sports color - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindpowe.red/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASports_color"/>
	<link rel="alternate" type="text/html" href="https://mindpowe.red/wiki/index.php?title=Module:Sports_color&amp;action=history"/>
	<updated>2026-04-06T21:14:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://mindpowe.red/wiki/index.php?title=Module:Sports_color&amp;diff=4930&amp;oldid=prev</id>
		<title>imported&gt;Frietjes: repair after changes to Module:Sports color/ice hockey</title>
		<link rel="alternate" type="text/html" href="https://mindpowe.red/wiki/index.php?title=Module:Sports_color&amp;diff=4930&amp;oldid=prev"/>
		<updated>2020-08-04T16:22:01Z</updated>

		<summary type="html">&lt;p&gt;repair after changes to &lt;a href=&quot;/wiki/index.php?title=Module:Sports_color/ice_hockey&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Module:Sports color/ice hockey (page does not exist)&quot;&gt;Module:Sports color/ice hockey&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--&lt;br /&gt;
-- This module implements&lt;br /&gt;
-- {{NBA color}}, {{NBA color cell}}, {{NBA color cell2}}&lt;br /&gt;
-- {{Euroleague color}}, {{Euroleague color cell}}, {{Euroleague color cell2}}, &lt;br /&gt;
-- {{NBL colour}}, {{NBL colour cell}}, {{NBL colour cell2}},&lt;br /&gt;
-- {{PBA color}}, {{PBA color cell}}, {{PBA color cell2}},&lt;br /&gt;
-- {{European leagues color}}, {{European leagues color cell}}, {{European leagues color cell2}},&lt;br /&gt;
-- {{KBL color}}, {{KBL color cell}}, {{KBL color cell2}}&lt;br /&gt;
--&lt;br /&gt;
-- {{Baseball color}}, {{Baseball primary color}}, {{Baseball secondary color}}, &lt;br /&gt;
-- {{Baseball alternative primary color}}, {{Baseball alternative secondary color}}&lt;br /&gt;
-- {{Baseball primary style}}, {{Baseball secondary style}}&lt;br /&gt;
--&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local data_module = 'Module:Sports color/basketball'&lt;br /&gt;
&lt;br /&gt;
local function stripwhitespace(text)&lt;br /&gt;
	return text:match(&amp;quot;^%s*(.-)%s*$&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function bordercss(c, w)&lt;br /&gt;
	local s = 'inset ' .. w .. 'px ' .. w .. 'px 0 #' .. c &lt;br /&gt;
		.. ', inset -' .. w .. 'px -' .. w .. 'px 0 #' .. c&lt;br /&gt;
	return '-moz-box-shadow: ' .. s .. '; -webkit-box-shadow: ' .. s .. '; box-shadow: ' .. s .. ';'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function get_colors(team, unknown)&lt;br /&gt;
	team = stripwhitespace(team or '')&lt;br /&gt;
	unknown = unknown or {&amp;quot;DCDCDC&amp;quot;, &amp;quot;000000&amp;quot;, &amp;quot;000000&amp;quot;, &amp;quot;FFFFFF&amp;quot;}&lt;br /&gt;
	&lt;br /&gt;
	local use_default = {&lt;br /&gt;
		[&amp;quot;&amp;quot;] = 1,&lt;br /&gt;
		[&amp;quot;retired&amp;quot;] = 1,&lt;br /&gt;
		[&amp;quot;free agent&amp;quot;] = 1,&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	local colors = nil&lt;br /&gt;
	&lt;br /&gt;
	if ( team and use_default[team:lower()] ) then&lt;br /&gt;
		colors = {&amp;quot;DCDCDC&amp;quot;, &amp;quot;000000&amp;quot;, &amp;quot;DCDCDC&amp;quot;, &amp;quot;000000&amp;quot;}&lt;br /&gt;
	else&lt;br /&gt;
		local all_colors = mw.loadData(data_module)&lt;br /&gt;
		colors = all_colors[team]&lt;br /&gt;
		if ( colors and type(colors) == 'string' ) then&lt;br /&gt;
			colors = all_colors[colors]&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return colors or unknown&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function team_check(team, unknown)&lt;br /&gt;
	local colors = get_colors(team, unknown)&lt;br /&gt;
	if type(colors) == 'table' then&lt;br /&gt;
		return 'known'&lt;br /&gt;
	else&lt;br /&gt;
		return unknown&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function team_color(team, num)&lt;br /&gt;
	local colors = get_colors(team, nil)&lt;br /&gt;
&lt;br /&gt;
	num = tonumber(num:match('[1-4]') or '0')&lt;br /&gt;
	if ( num ) then&lt;br /&gt;
		return colors[num]&lt;br /&gt;
	else&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function team_colorcell(team, borderwidth, bg, fg, bd, simple)&lt;br /&gt;
	local colors = get_colors(team, nil)&lt;br /&gt;
	local border = ''&lt;br /&gt;
	borderwidth = borderwidth or ''&lt;br /&gt;
	&lt;br /&gt;
	if (borderwidth ~= '') then&lt;br /&gt;
		local bordercolor = stripwhitespace(colors[bd]) or 'FFFFFF'&lt;br /&gt;
		if bordercolor ~= 'FFFFFF' then&lt;br /&gt;
			if simple then&lt;br /&gt;
				border = 'border:' .. borderwidth .. 'px solid #' .. bordercolor .. ';'&lt;br /&gt;
			else&lt;br /&gt;
				border = bordercss(bordercolor, borderwidth)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return 'background-color:#' .. stripwhitespace(colors[bg]) .. ';color:#' .. stripwhitespace(colors[fg]) .. ';' .. border&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function team_titlestripe(team, topc, botc, borderwidth)&lt;br /&gt;
	local colors = get_colors(team, nil)&lt;br /&gt;
	local border = ''&lt;br /&gt;
	borderwidth = borderwidth or ''&lt;br /&gt;
&lt;br /&gt;
	if (borderwidth ~= '') then&lt;br /&gt;
		local bordercolor = stripwhitespace(colors[topc]) or 'FFFFFF'&lt;br /&gt;
		if bordercolor ~= 'FFFFFF' then&lt;br /&gt;
			border = border .. 'border-top:' .. borderwidth .. 'px solid #' .. bordercolor .. ';'&lt;br /&gt;
		end&lt;br /&gt;
		bordercolor = stripwhitespace(colors[botc]) or bordercolor&lt;br /&gt;
		if bordercolor ~= 'FFFFFF' then&lt;br /&gt;
			border = border .. 'border-bottom:' .. borderwidth .. 'px solid #' .. bordercolor .. ';'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return 'background-color:#FFFFFF;' .. border&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function team_cellborder(team, pri, sec, ter, borderwidth, simple)&lt;br /&gt;
	local colors = get_colors(team, nil)&lt;br /&gt;
	local border = ''&lt;br /&gt;
	borderwidth = borderwidth or ''&lt;br /&gt;
&lt;br /&gt;
	if (borderwidth ~= '') then&lt;br /&gt;
		local bordercolor = stripwhitespace(colors[pri] or colors[sec] or colors[ter]) or 'FFFFFF'&lt;br /&gt;
		if bordercolor ~= 'FFFFFF' then&lt;br /&gt;
			if simple then&lt;br /&gt;
				border = 'border:' .. borderwidth .. 'px solid #' .. bordercolor .. ';'&lt;br /&gt;
			else&lt;br /&gt;
				border = bordercss(bordercolor, borderwidth)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return 'background-color:#FFFFFF;' .. border&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.check(frame)&lt;br /&gt;
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	data_module = 'Module:Sports color/' .. (frame.args['sport'] or frame:getParent().args['sport'] or 'basketball')&lt;br /&gt;
	return team_check(args[1] or '', args[2] or '')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.color(frame)&lt;br /&gt;
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	data_module = 'Module:Sports color/' .. (frame.args['sport'] or frame:getParent().args['sport'] or 'basketball')&lt;br /&gt;
	return team_color(args[1] or '', args[2] or '')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.colorcell(frame)&lt;br /&gt;
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	data_module = 'Module:Sports color/' .. (frame.args['sport'] or frame:getParent().args['sport'] or 'basketball')&lt;br /&gt;
	return team_colorcell(args[1] or '', args['border'] or '', 1, 2, 3, args['simple'] and 1 or nil )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.colorcell2(frame)&lt;br /&gt;
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	data_module = 'Module:Sports color/' .. (frame.args['sport'] or frame:getParent().args['sport'] or 'basketball')&lt;br /&gt;
	return team_colorcell(args[1] or '', args['border'] or '', 3, 4, 1, args['simple'] and 1 or nil )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.titlestripe(frame)&lt;br /&gt;
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	data_module = 'Module:Sports color/' .. (frame.args['sport'] or frame:getParent().args['sport'] or 'ice hockey')&lt;br /&gt;
	return team_titlestripe(args[1] or '', 1, 3, args['width'] or '5')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.cellborder(frame)&lt;br /&gt;
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	data_module = 'Module:Sports color/' .. (frame.args['sport'] or frame:getParent().args['sport'] or 'ice hockey')&lt;br /&gt;
	return team_cellborder(args[1] or '', 3, 1, 4, args['width'] or '2', args['simple'] and 1 or nil )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.cellborder2(frame)&lt;br /&gt;
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	data_module = 'Module:Sports color/' .. (frame.args['sport'] or frame:getParent().args['sport'] or 'ice hockey')&lt;br /&gt;
	return team_cellborder(args[1] or '', 4, 3, 1, args['width'] or '2', args['simple'] and 1 or nil )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Frietjes</name></author>
		
	</entry>
</feed>