Pojdi na vsebino

Modul:College color

Iz Wikipedije, proste enciklopedije
Documentation icon Dokumentacija modula[predogled] [uredi] [zgodovina] [osveži]


This module is used by

{{CollegePrimaryHex}}, {{CollegePrimaryStyle}}, {{CollegePrimaryColorLink}},
{{CollegeSecondaryHex}}, {{CollegeSecondaryStyle}}, {{CollegeSecondaryColorLink}},
{{NCAA color}}, {{NCAA color cell}}, {{NCAA secondary color cell}}
{{Infobox baseball biography/style}}
{{Infobox basketball biography/style}}
{{CBB roster/Header}}

Usage

[uredi kodo]
  • {{#invoke:College color|color}} in the NCAA color template
  • {{#invoke:College color|color1}} in the primary color template
  • {{#invoke:College color|color32}} in the secondary color template
  • {{#invoke:College color|style1}} in the primary style template
  • {{#invoke:College color|style2}} in the secondary style template
  • {{#invoke:College color|header1}} in the primary header style of an infobox
  • {{#invoke:College color|header2}} in the secondary header style of an infobox
  • {{#invoke:College color|stripe1}} in the primary header style of an infobox
  • {{#invoke:College color|check}} to check to see if a team has defined colors

Updating team colors

[uredi kodo]

See Module:college color/data.

Test table

[uredi kodo]
Team123Contrast
1/22/33/11/w1/b
Abilene Christian Wildcats7.381.54.937.382.84
Air Force Falcons9.852.264.369.852.13
Akron Zips14.331.977.2614.331.47
Alabama A&M Bulldogs
aka Alabama A&M Lady Bulldogs
X8.618.612.44
Alabama Crimson TideX8.928.922.35
Alabama State Hornets211.414.97211
Alabama–Huntsville Chargers
aka UAH Chargers
X7.287.282.89
Alaska Anchorage Seawolves9.641.745.549.642.18
Alaska Nanooks
aka Alaska-Fairbanks Nanooks
6.581.414.666.583.19
Albany Great Danes12.281.567.8612.281.71
Alberta Golden Bears11.531.1510.0211.531.82
Alcorn State Braves
aka Alcorn State Lady Braves
X9.429.422.23
American International Yellow Jackets
aka AIC Yellow Jackets
211.6212.98211
Angelo State Rams7.611.674.567.612.76
Appalachian State Mountaineers15.911.5110.5215.911.32
Arizona State Sun Devils9.31.595.869.32.26
Arizona Wildcats5.8112.612.175.813.62
Arkansas RazorbacksX7.747.742.71
Arkansas State Red Wolves5.76213.655.763.65
Arkansas-Pine Bluff Golden Lions211.414.97211
Army Black Knights212.0310.33211
Auburn Tigers15.43.93.9515.41.36
Austin Peay Governors
aka Austin Peay Lady Govs
aka Austin Peay State Governors
aka Austin Peay State Lady Govs
X5.845.843.59
BYU–Hawaii Seasiders8.921.515.98.922.35
Baker WildcatsX5.112.657.93
Ball State CardinalsX5.845.843.59
Baylor Bears14.651.539.614.651.43
Belmont Bruins10.285.631.8310.282.04
Bemidji State BeaversX12.5112.511.68
Bentley FalconsX21211
Bethune-Cookman Wildcats101.975.06102.1
Binghamton BearcatsX6.56.53.23
Birmingham-Southern Panthers211.3116.02211
Bishop's Gaiters
aka Bishops Gaiters
12.222.355.212.221.72
Boise State Broncos11.773.23.6811.771.78
Boston College Eagles8.612.243.848.612.44
Boston University TerriersX5.895.893.57
Bowling Green Falcons2.7312.284.52.737.7
Bradley BravesX8.088.082.6
Brigham Young University Cougars
aka BYU Cougars
aka Brigham Young Cougars
X14.9414.941.41
Brown Bears16.865.842.8816.861.25
Bucknell Bison3.3911.833.493.396.2
Buffalo BullsX12.9112.911.63
Butler BulldogsX9.059.052.32
CCNY Beavers3.01216.983.016.98
Cal Poly Mustangs10.881.298.4410.881.93
Cal State Bakersfield Roadrunners6.581.524.336.583.19
Cal State Fullerton Titans9.172.533.629.172.29
Cal State Northridge MatadorsX5.145.144.09
Calgary Dinos5.891.513.895.893.57
California Golden Bears16.541.5610.616.541.27
California Vulcans8.92212.358.922.35
Canisius Golden Griffins15.32.037.5415.31.37
Carlisle Indians7.312.033.597.312.87
Catawba IndiansX16.0116.011.31
Central Arkansas Bears
aka Central Arkansas Sugar Bears
10.842.793.8810.841.94
Central Connecticut Blue DevilsX7.757.752.71
Central Michigan Chippewas12.661.558.1712.661.66
Central Missouri Mules
aka Central Missouri Jennies
5.39213.95.393.9
Central Oklahoma Bronchos12.611.518.3412.611.67
Central State Marauders10.141.456.9910.142.07
Central Washington WildcatsX5.815.813.62
Centre Colonels
aka Centre Praying Colonels
X2.032.0310.33
Charlotte 49ersX6.216.213.38
Chattanooga Mocs
aka Chattanooga Lady Mocs
11.812.125.5811.811.78
Chicago MaroonsX13.4213.421.56
Cincinnati Bearcats2154.2211
Citadel Bulldogs
aka The Citadel Bulldogs
3.5915.624.353.595.85
Clarkson Golden Knights9.561.476.59.562.2
Clemson Tigers
aka Clemson Lady Tigers
3.0410.263.383.046.91
Cleveland State VikingsX6.636.633.17
Coastal Carolina Chanticleers4.773.741.284.774.4
Colgate RaidersX10.9510.951.92
College of Charleston CougarsX10.9510.951.92
Colorado Buffaloes211.9410.8211
Colorado College TigersX11.13211
Colorado State Rams6.51.514.316.53.23
Columbia LionsX2.292.299.17
Connecticut HuskiesX19.0219.021.1
Cornell Big RedX6.86.83.09
Creighton BluejaysX17.6217.621.19
Cumberland Bulldogs9.05212.329.052.32
Dartmouth Big GreenX6.676.673.15
Davidson Wildcats9212.3392.33
Dayton Flyers5.558.781.585.553.78
DePaul Blue Demons9.634.362.219.632.18
Delaware Fightin' Blue Hens7.671.455.297.672.74
Delaware State HornetsX3.084.574.6
Denver Pioneers8.814.691.888.812.38
Detroit Titans4.276.991.644.274.92
Drake Bulldogs10.033.013.3410.032.09
Drexel DragonsX9.314.651.43
Duke Blue DevilsX10.1310.132.07
Duquesne Dukes15.855.892.6915.851.32
East Carolina Pirates9.891.566.359.892.12
East Central Tigers3.25216.463.256.46
Eastern Arizona Gila MonstersX15.6415.641.34
Eastern Illinois Panthers3.84215.473.845.47
Eastern Kentucky ColonelsX10.9510.951.92
Eastern Michigan EaglesX7.447.442.82
Eastern Washington Eagles8.27212.548.272.54
Elon PhoenixX5.3810.951.92
Emporia State Hornets
aka Emporia State Lady Hornets
16.33.035.3816.31.29
Evansville Purple AcesX9.599.592.19
Ferris State Bulldogs5.811.573.695.813.62
Florida A&M Rattlers9.052.743.39.052.32
Florida Atlantic Owls
aka FAU Owls
12.615.892.1412.611.67
Florida Gators11.933.373.5411.931.76
Florida Gulf Coast Eagles13.254.52.9513.251.58
Florida International Golden Panthers
aka FIU Golden Panthers
aka FIU Panthers
aka Florida International Panthers
13.532.714.9913.531.55
Florida State Seminoles9.211.944.759.212.28
Fordham RamsX9.989.982.1
Fort Hays State Tigers211.6912.43211
Fort Valley State WildcatsX88.592.44
Fresno State Bulldogs6.8213.251.946.823.08
Furman Paladins
aka Furman Purple Hurricane
9.992.384.29.992.1
Gallaudet Bison9.81.466.719.82.14
Gardner–Webb Runnin' Bulldogs5.44213.865.443.86
George Mason Patriots7.121.514.737.122.95
George Washington ColonialsX9.2114.941.41
Georgetown Hoyas16.624.243.9216.621.26
Georgia Bulldogs4.8714.282.934.874.32
Georgia Southern Eagles17.622.965.9617.621.19
Georgia State PanthersX9.839.832.14
Georgia Tech Yellow Jackets
aka Georgia Tech Golden Tornado
2.7415.345.62.747.67
Gonzaga BulldogsX14.4214.421.46
Grand Canyon AntelopesX10.2610.262.05
Grantham TalonsX8.7612.611.67
Green Bay PhoenixX7.127.122.95
Grinnell PioneersX5.5211
Hampton Pirates7.742.612.977.742.71
Hartford HawksX3.823.825.5
Hartwick HawksX7.437.432.83
Harvard Crimson7.77212.77.772.7
Hawaii Warriors
aka Hawaii Rainbow Wahine
aka Hawaii Rainbows
aka Hawaii Rainbow Warriors
X10.7810.781.95
High Point PanthersX12.8912.891.63
Hobart Statesmen2.539.423.722.538.29
Holy Cross CrusadersX4.554.554.61
Houston Baptist HuskiesX5.7914.661.43
Houston CougarsX5.895.893.57
Idaho State Bengals212.767.6211
Idaho VandalsX6.93.046.9
Illinois Fighting Illini3.9514.523.683.955.32
Illinois State RedbirdsX5.635.633.73
Incarnate Word CardinalsX5.2545.25
Indiana HoosiersX7.5110.731.96
Indiana State SycamoresX8.158.152.58
Iona Gaels8.741.515.788.742.4
Iowa Hawkeyes211.3116.02211
Iowa State Cyclones7.431.554.787.432.82
Jackson State TigersX16.0516.051.31
Jacksonville Dolphins7.812.113.717.812.69
Jacksonville State GamecocksX4.534.534.64
James Madison Dukes13.242.475.3613.241.59
Johns Hopkins Blue Jays3.49216.023.496.02
Johnson C. Smith Golden Bulls13.911.489.3913.911.51
Kansas Jayhawks11.124.732.3511.121.89
Kansas State WildcatsX10.4510.452.01
Kennesaw State Owls211.9210.93211
Kent State Golden Flashes15.472.057.5515.471.36
Kentucky WildcatsX6.676.673.15
La Salle Explorers11.811.567.5511.811.78
Lafayette LeopardsX10.9510.951.92
Lake Superior State Lakers7.661.594.817.662.74
Lamar Cardinals
aka Lamar Lady Cardinals
X4.714.714.46
Lehigh Mountain HawksX12.312.31.71
Liberty Flames
aka Liberty Lady Flames
15.137.442.0315.131.39
Lincoln Blue Tigers15.313.324.6115.311.37
Lindenwood Lions
aka Lindenwood Lady Lions
211.5713.42211
Lipscomb Bisons
aka Lipscomb Lady Bisons
14.441.987.2914.441.45
Long Beach State 49ers211.3315.81211
Long Island BlackbirdsX21211
Louisiana State Tigers
aka LSU Tigers
12.161.488.2312.161.73
Louisiana Tech Bulldogs
aka Louisiana Tech Lady Techsters
11.84.762.4811.81.78
Louisiana–Lafayette Ragin' Cajuns
aka Louisiana Ragin' Cajuns
aka Louisiana-Lafayette Ragin' Cajuns
8.24212.558.242.55
Louisiana–Monroe Warhawks
aka Louisiana-Monroe Warhawks
aka ULM Warhawks
13.423.144.2713.421.56
Louisville Cardinals7.56212.787.562.78
Lourdes Gray Wolves3.09216.793.096.79
Loyola Marymount Lions9.6312.791.339.632.18
Loyola Ramblers10.951.517.2410.951.92
Maine Black Bears12.833.184.0312.831.64
Manitoba Bisons6.361.44.536.363.3
Marquette Warriors
aka Marquette Golden Eagles
11.751.76.911.751.79
Marshall Thundering HerdX3.633.635.78
Maryland Terrapins5.881.4745.883.57
Massachusetts MinutemenX10.9510.951.92
McGill RedmenX445.25
McNeese State Cowboys
aka McNeese State Cowgirls
10.51.497.0410.52
Memphis Tigers13.671.628.4213.671.54
Mercer Bears3.01216.983.016.98
Mercyhurst LakersX7.127.122.95
Merrimack Warriors18.681.4213.1518.681.12
Miami Hurricanes9.592.873.349.592.19
Miami RedHawksX5.635.633.73
Michigan State SpartansX10.7510.751.95
Michigan Tech Huskies211.4914.08211
Michigan Wolverines15.061.529.8915.061.39
Middle Tennessee State Blue Raiders
aka Middle Tennessee Blue Raiders
X5.575.573.77
Midwestern State Mustangs10.841.955.5710.841.94
Milwaukee Panthers211.712.33211
Minnesota Golden Gophers11.41.517.5711.41.84
Minnesota State Mavericks
aka MSU-Mankato Mavericks
aka Mankato State Mavericks
aka Minnesota State–Mankato Mavericks
10.261.337.7310.262.05
Minnesota–Duluth Bulldogs10.951.47.8110.951.92
Mississippi Rebels
aka Ole Miss Rebels
8.414.991.698.412.5
Mississippi State BulldogsX13.4213.421.56
Mississippi Valley State Delta DevilsX4.394.394.78
Missouri S&T Miners8.841.725.148.842.38
Missouri Southern Lions12.121.587.6912.121.73
Missouri State BearsX14.1914.191.48
Missouri Tigers211.8111.63211
Missouri Western Griffons211.613.14211
Monmouth HawksX16.0917.281.22
Montana Grizzlies
aka Montana Lady Griz
14.063.294.2814.061.49
Montana State Bobcats15.162.17.2115.161.39
Morehead State Eagles14.381.4210.1314.381.46
Mount Union Purple RaidersX11.9911.991.75
Mountain West ConferenceX4.7310.432.01
Murray State Racers17.281.412.3217.281.22
NJIT HighlandersX445.25
Navy Midshipmen16.012.17.6116.011.31
Nebraska CornhuskersX4.575.154.07
Nebraska–Kearney Lopers11.922.84.2511.921.76
Nevada Wolf Pack12.612.854.4312.611.67
New Hampshire WildcatsX11.811.81.78
New Mexico Lobos6.326.541.036.323.32
New Mexico State AggiesX13.4213.421.56
New Orleans Privateers
aka UNO Privateers
7.822.363.327.822.69
Niagara Purple EaglesX12.1612.161.73
Nicholls State Colonels6.042.042.966.043.48
Norfolk State Spartans10.51.676.2710.52
North Alabama Lions13.741.519.0913.741.53
North Carolina Central EaglesX8.548.542.46
North Carolina State Wolfpack
aka NC State Wolfpack
5.89213.575.893.57
North Carolina Tar HeelsX2.352.358.92
North Dakota
aka North Dakota Fighting Sioux
X3.683.685.71
North Dakota State Bison8.681.565.568.682.42
North Florida Ospreys16.711.98.7916.711.26
North Texas Mean GreenX4.754.754.42
Northeastern Huskies5.89213.575.893.57
Northeastern State RiverHawks4.792.581.864.794.38
Northern Arizona Lumberjacks12.611.518.3412.611.67
Northern Illinois Huskies5.84213.595.843.59
Northern Iowa PanthersX7.3910.372.02
Northern Kentucky Norse211.414.97211
Northern Michigan Wildcats13.21.747.5813.21.59
Northwest Missouri State BearcatsX6.936.933.03
Northwestern State Demons
aka Northwestern State Lady Demons
8.412.942.868.412.5
Northwestern WildcatsX14.1614.161.48
Notre Dame Fighting IrishX7.114.031.5
Oakland Golden Grizzlies213.85.53211
Oglethorpe Stormy Petrels211.1618.08211
Ohio BobcatsX6.636.633.17
Ohio State Buckeyes6.755.741.176.753.11
Oklahoma Baptist Bison7.641.864.17.642.75
Oklahoma Christian Eagles13.421.618.3613.421.56
Oklahoma City Stars8.91212.368.912.36
Oklahoma SoonersX9.359.962.11
Oklahoma State Cowboys
aka Oklahoma State Cowgirls
aka Oklahoma A&M Aggies
2.73217.72.737.7
Old Dominion Monarchs13.92.236.2313.91.51
Omaha Mavericks
aka UNO Mavericks
aka Nebraska–Omaha Mavericks
6.08213.466.083.46
Oral Roberts Golden Eagles13.332.934.5413.331.58
Oregon Ducks
aka Oregon Webfoots
10.61.318.0810.61.98
Oregon State Beavers5.03214.175.034.17
Ouachita Baptist Tigers12.111.358.9512.111.73
Pacific Tigers2.53218.292.538.29
Penn Quakers
aka Pennsylvania Quakers
14.089.161.5414.081.49
Penn State Nittany LionsX14.3914.391.46
Pepperdine Waves11.934.12.9111.931.76
Pittsburg State Gorillas5.491.473.735.493.83
Pittsburgh Panthers
aka Pitt Panthers
15.291.957.8315.291.37
Portland PilotsX12.1612.161.73
Portland State VikingsX11.0711.071.9
Prairie View Panthers15.761.5110.4615.761.33
Princeton Tigers3.01216.983.016.98
Providence Friars211.8211.54211
Purdue BoilermakersX7.32211
Quinnipiac Bobcats14.61.69.1114.61.44
RIT Tigers7.061.823.882.977.06
RPI Engineers
aka Rensselaer Engineers
X5.845.843.6
Regina Rams9.61.486.499.62.19
Rhode Island Rams2.2912.715.552.299.17
Rice Owls14.426.312.2814.421.46
Richmond Spiders17.628.921.9817.621.19
Rider BroncsX13.1113.111.6
Robert Morris Colonials
aka RMU Colonials
X15.3115.311.37
Rockhurst HawksX7.27.22.92
Rutgers Scarlet KnightsX5.435.433.86
Sacramento State Hornets8.642.094.138.642.43
Sacred Heart Pioneers8.922.553.58.922.35
Saint Joseph's HawksX8.928.922.35
Saint Louis BillikensX11.2211.221.87
Saint Mary's Gaels18.825.893.218.821.12
Sam Houston State Bearkats2.948.592.932.947.15
Samford Bulldogs5.8513.922.385.853.59
San Diego State Aztecs5.56213.775.563.77
San Diego Toreros14.941.728.6914.941.41
San Francisco Dons7.121.514.737.122.95
San Francisco State GatorsX6.729.422.23
San Jose State Spartans
aka San José State Spartans
7.442.113.537.442.82
Santa Clara Broncos7.561.236.147.562.78
Saskatchewan HuskiesX9.69.62.19
Savannah State Lady Tigers
aka Savannah State Tigers
4.3112.542.914.314.87
Seton Hall Pirates8.591.55.748.592.44
Sewanee Tigers9.991.735.779.992.1
Simon Fraser Clan13.756.042.2813.751.53
South Alabama Jaguars17.6244.4117.621.19
South Carolina Gamecocks12.12211.7312.121.73
South Carolina State BulldogsX9.099.092.31
South Dakota Coyotes7.56212.787.562.78
South Dakota State Jackrabbits10.471.467.1710.472.01
South Florida Bulls6.931.753.956.933.03
Southeast Missouri State Redhawks5.88213.575.883.57
Southeastern Louisiana Lions
aka Southeastern Louisiana Lady Lions
6.842.123.236.843.07
Southern Connecticut State OwlsX14.2214.221.48
Southern Illinois Salukis13.42211.5613.421.56
Southern Methodist University Mustangs
aka SMU Mustangs
5.639.851.755.633.73
Southern Miss Golden EaglesX14.36211
Southern Utah Thunderbirds5.58213.775.583.77
Southwest Baptist BearcatsX9.999.992.1
Southwestern Oklahoma State Bullogs12.123.433.5412.121.73
St. Bonaventure BonniesX8.228.222.55
St. Cloud State Huskies5.84213.595.843.59
St. Francis Brooklyn Terriers11.314.662.4311.311.86
St. John's Red StormX445.25
St. Lawrence SaintsX6.896.893.05
Stanford Cardinal
aka Stanford Indians
aka Stanford
X9.49.42.23
Stephen F. Austin Lumberjacks
aka Stephen F. Austin Ladyjacks
X15.7615.761.33
Stetson HattersX4.114.115.12
Stillman Tigers17.621.839.6517.621.19
Stony Brook Seawolves3.995.921.483.995.26
Syracuse Orange
aka Syracuse Orangemen
3.1512.884.083.156.66
Temple OwlsX7.997.992.63
Tennessee State TigersX10.8610.861.93
Tennessee Tech Golden Eagles10.371.516.8610.372.02
Tennessee Volunteers
aka Tennessee Lady Volunteers
X2.632.637.99
Tennessee–Martin Skyhawks
aka Tennessee-Martin Skyhawks
15.292.496.1515.291.37
Texas A&M AggiesX15.6615.661.34
Texas A&M–Corpus Christi Islanders5.125.611.15.124.11
Texas A&M–Kingsville Javelinas10.861.517.1810.861.93
Texas Christian University Horned Frogs
aka TCU Horned Frogs
X12.1312.131.73
Texas LonghornsX4.594.594.58
Texas Southern Tigers
aka Texas Southern Lady Tigers
5.7410.951.915.743.66
Texas State Bobcats14.614.483.2614.611.44
Texas Tech Red Raiders
aka Texas Tech Lady Raiders
5.89213.575.893.57
Toledo Rockets13.971.439.7513.971.5
Towson TigersX13.89211
Troy Trojans9.63212.189.632.18
Truman BulldogsX10.410.42.02
Tulane Green Wave14.671.4110.3714.671.43
Tulsa Golden Hurricane4.522.841.597.552.78
Tuskegee Golden TigersX2.454.994.21
UAB Blazers6.41.723.736.43.28
UBC Thunderbirds6.081.553.916.083.45
UC Davis Aggies14.642.655.5114.641.43
UC Irvine Anteaters6.251.454.316.253.36
UC Riverside Highlanders5.231.992.635.234.02
UC Santa Barbara Gauchos9.851.974.999.852.13
UCF Knights212.618.03211
UCLA Bruins4.271.72.524.274.92
UConn HuskiesX19.0219.021.1
UIC Flames12.615.812.1712.611.67
UMBC Retrievers211.6212.98211
UMSL Tritons6.851.913.596.853.07
UMass Lowell River Hawks7.634.751.617.632.75
UMass Minutemen
aka UMass Minutewomen
X10.9510.951.92
UNC Wilmington Seahawks6.871.315.236.873.06
UNLV Rebels
aka UNLV Runnin' Rebels
aka UNLV Lady Rebels
6.415.741.126.413.28
USC Trojans8.921.515.98.922.35
USC Upstate SpartansX9.019.012.33
UT Arlington MavericksX2.632.638
UTEP Miners
aka Texas Western Miners
3.1916.055.033.196.58
UTPA Broncs9.722.873.399.722.16
UTSA Roadrunners15.793.374.6815.791.33
UW-EAU Claire BlugoldsX11.3316.011.31
UW-Green Bay PhoenixX7.127.122.95
Union Dutchmen
aka Union Dutchwomen
X9.059.052.32
Utah State AggiesX12.6112.611.67
Utah UtesX5.895.893.57
Utah Valley Wolverines7.391.465.067.392.84
VCU Rams211.7112.28211
VMI Keydets5.11.663.075.14.12
Valparaiso Crusaders15.441.5110.2115.441.36
Vanderbilt Commodores213.855.46211
Vermont Catamounts7.021.554.517.022.99
Villanova Wildcats12.613.263.8612.611.67
Virginia Cavaliers15.822.965.3415.821.33
Virginia Tech Hokies11.472.834.0511.471.83
Wake Forest Demon Deacons3.82215.53.825.5
Washburn IchabodsX12.2712.271.71
Washington Huskies10.221.476.9410.222.06
Washington State Cougars8.185.561.478.182.57
Washington University Bears
aka WUSTL Bears
5.88.451.465.83.62
Washington and Lee Generals
aka Washington & Lee Generals
X14.6614.661.43
Wayne State Warriors7.291.564.687.292.88
Weber State WildcatsX7.387.382.84
West Alabama TigersX445.25
West Liberty State HilltoppersX19.56211
West Texas A&M Buffaloes13.425.742.3413.421.56
West Virginia Mountaineers14.642.057.1414.641.43
Western Carolina CatamountsX4.279.842.13
Western Illinois LeathernecksX5.267.382.84
Western Kentucky Hilltoppers
aka WKU Lady Toppers
aka WKU Hilltoppers
X6.876.873.06
Western Michigan Broncos13.852.77513.851.52
Western Ontario MustangsX9.429.422.23
Western Oregon WolvesX445.25
Wichita State Shockers211.6113.07211
Willamette BearcatsX2.875.843.59
William & Mary Tribe8.531.884.548.532.46
Windsor LancersX9.3113.751.53
Wisconsin BadgersX6.966.963.02
Wisconsin–Whitewater WarhawksX13.6513.651.54
Wofford Terriers4.16215.054.165.05
Wright State Raiders7.461.45.327.462.82
Wyoming Cowboys11.151.567.1411.151.88
Xavier MusketeersX15.4615.461.36
Yale BulldogsX8.418.412.5
Youngstown State PenguinsX6.496.493.23
Free agentX15.311.3715.31
RetiredX15.311.3715.31


--
-- This module implements {{CollegePrimaryHex}}, {{CollegePrimaryStyle}}, 
-- {{CollegePrimaryColorLink}}, {{CollegeSecondaryHex}}, 
-- {{CollegeSecondaryStyle}}, {{CollegeSecondaryColorLink}}, and {{NCAA color}}
--
local p = {}

local data_module = "Modul:College color/data"

local function stripwhitespace(text)
	return text:match("^%s*(.-)%s*$")
end
local function sRGB ( v ) 
	if (v <= 0.03928) then 
		v = v / 12.92
	else
		v = math.pow((v+0.055)/1.055, 2.4)
    end
	return v
end
local function color2lum( c )
	c = stripwhitespace(c or ''):lower()

	-- remove leading # (if there is one)
	c = mw.ustring.match(c, '^[#]*([a-f0-9]*)$')
 
	-- split into rgb
	local cs = mw.text.split(c or '', '')
	if( #cs == 6 ) then
	 	local R = sRGB( (16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2]))/255 )
		local G = sRGB( (16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4]))/255 )
		local B = sRGB( (16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6]))/255 )
 
		L = 0.2126 * R + 0.7152 * G + 0.0722 * B
		return L
	elseif ( #cs == 3 ) then
	 	local R = sRGB( (16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1]))/255 )
		local G = sRGB( (16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2]))/255 )
		local B = sRGB( (16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3]))/255 )
 
		L = 0.2126 * R + 0.7152 * G + 0.0722 * B
		return L
	end
 
	-- failure, return blank
	return ''
end

local function get_colors(team, unknown)
	team = stripwhitespace(team or '')
	unknown = unknown or {"DCDCDC", "000000"}
	
	local use_default = {
		[""] = 1,
		["retired"] = 1,
		["free agent"] = 1,
	}
	
	local colors = nil
	
	if ( team and use_default[team:lower()] ) then
		colors = {"DCDCDC", "000000"}
	else
		local all_colors = mw.loadData(data_module)
		colors = all_colors[team]
		if ( colors and type(colors) == 'string' ) then
			colors = all_colors[colors]
		end
	end

	return colors or unknown
end

local function team_color(team, num, num2)
	local colors = get_colors(team, nil)

	num = tonumber(num:match('[1-3]') or '0')
	num2 = tonumber(num2:match('[1-3]') or '0')
	if ( num ) then
		return colors[num] or colors[num2] or ''
	else
		return ''
	end
end

local function team_style1(team, borderwidth, fontcolor)
	local colors = get_colors(team, nil)
	
	local color = '#' .. (colors[3] or colors[2] or '')
	local style = 'background-color:#' .. (colors[1] or '') .. ';color:' .. (fontcolor or color) .. ';'
	borderwidth = tonumber(borderwidth or '2') or 0
	if (borderwidth > 0 and color ~= '#FFFFFF') then
		style = style .. ' border:' .. borderwidth .. 'px solid ' .. color .. ';'
	end
	
	return style
end

local function team_style2(team, borderwidth, fontcolor)
	local colors = get_colors(team, nil)
	
	local color = '#' .. (colors[1] or '')
	local style = 'background-color:#' .. (colors[3] or colors[2] or '') .. ';color:' .. (fontcolor or color) .. ';'
	borderwidth = tonumber(borderwidth or '2') or 0
	if (borderwidth > 0 and color ~= '#FFFFFF') then
		style = style .. ' border:' .. borderwidth .. 'px solid ' .. color .. ';'
	end
	
	return style
end

local function team_header1(team)
	local colors = get_colors(team, nil)
	-- set the default background
	local background = (colors[1] or 'FFFFFF'):upper()
	-- set background to white if it's nearly white
	if ((1 + 0.05)/(color2lum(background) + 0.05) < 1.25) then
		background = 'FFFFFF'
	end
	-- now pick a font color
	local fontcolor = '000000'
	-- compute the luminosity of the background
	local lum = color2lum(background)
	-- compute the contrast with white and black
	local wcontrast = (1 + 0.05)/(lum + 0.05)
	local bcontrast = (lum + 0.05)/(0 + 0.05)
	-- select the text color with the best contrast
	if( bcontrast > wcontrast + 1.25 ) then
		fontcolor = '000000'
	else
		fontcolor = 'FFFFFF'
	end
	if( background == 'FFFFFF' ) then
		return 'background-color:none;color:#' .. fontcolor .. ';'
	else
		return 'background-color:#' .. background .. ';color:#' .. fontcolor .. ';'
	end
end

local function team_header2(team)
	local colors = get_colors(team, nil)
	-- set the default background
	local background = (colors[3] or colors[2] or 'FFFFFF'):upper()
	-- set background to white if it's nearly white
	if ((1 + 0.05)/(color2lum(background) + 0.05) < 1.25) then
		background = 'FFFFFF'
	end
	-- if the background is white, then use the primary background instead
	if( background == 'FFFFFF' ) then
		background = (colors[1] or 'FFFFFF'):upper()
	end
	-- now pick a font color
	local fontcolor = '000000'
	-- compute the luminosity of the background
	local lum = color2lum(background)
	-- compute the contrast with white and black
	local wcontrast = (1 + 0.05)/(lum + 0.05)
	local bcontrast = (lum + 0.05)/(0 + 0.05)
	-- select the text color with the best contrast
	if( bcontrast > wcontrast + 1.25 ) then
		fontcolor = '000000'
	else
		fontcolor = 'FFFFFF'
	end
	if( background == 'FFFFFF' ) then
		return 'background-color:none;color:#' .. fontcolor .. ';'
	else
		return 'background-color:#' .. background .. ';color:#' .. fontcolor .. ';'
	end
end

local function team_stripe1(team, borderwidth)
	local colors = get_colors(team, nil)
	
	-- set the default scheme
	local background = colors[1] or ''
	local fontcolor = colors[2] or ''
	local bordercolor = (colors[3] or colors[2] or ''):upper()
	borderwidth = tonumber(borderwidth or '3') or 0
	
	-- if there is no tertiary color, then pick a font color
	if (colors[3] == nil) then
		-- compute the luminosity of the background
		local lum = color2lum(colors[1])
		-- compute the contrast with white and black
		local wcontrast = (1 + 0.05)/(lum + 0.05)
		local bcontrast = (lum + 0.05)/(0 + 0.05)
		-- select the text color with the best contrast
		if( bcontrast > wcontrast + 1.25 ) then
			fontcolor = '000000'
		else
			fontcolor = 'FFFFFF'
		end
	end

	-- finally build the style string
	local style = ''
	if (borderwidth > 0) then
		-- use the primary as the border if the border is white or close to white
		local bordercontrast = (1 + 0.05)/(color2lum(bordercolor) + 0.05)
		if (bordercontrast < 1.25) then
			bordercolor = background
			local fontcontrast = (1 + 0.05)/(color2lum(colors[2] or 'FFFFFF') + 0.05)
			if (fontcontrast < 1.25) then
				fontcolor = colors[2] or 'FFFFFF'
			end
		end
		style = style .. ' border:' .. borderwidth .. 'px solid #' .. bordercolor .. ';'
		style = style .. ' border-left: none; border-right: none;'
		style = style .. ' box-shadow: inset 0 2px 0 #FEFEFE, inset 0 -2px 0 #FEFEFE;'
	end
	style = 'background-color:#' .. background .. ';color:#' .. fontcolor .. ';' .. style
	
	return style
end

local function team_check(team, unknown)
	local colors = get_colors(team, unknown)
	if type(colors) == 'table' then
		return 'known'
	else
		return unknown
	end
end

function p.color(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_color(args[1] or '', args[2] or '', args[3] or '')
end

function p.color1(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_color(args[1] or '', '1', '')
end

function p.color32(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_color(args[1] or '', '3', '2')
end

function p.style1(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_style1(args[1] or '', args['border'], args['color'])
end

function p.style2(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_style2(args[1] or '', args['border'], args['color'])
end

function p.header1(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_header1(args[1] or '')
end

function p.header2(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_header2(args[1] or '')
end

function p.stripe1(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_stripe1(args[1] or '', args['border'])
end

function p.check(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_check(args[1] or '', args[2] or '')
end

function p.testtable(frame)
	local contrasttable_mod = require("Module:College color/contrast")
	return contrasttable_mod._testtable(frame.args)
end

return p