This module implements the colors for college athletic programs and 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}}
  • {{#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

ಬದಲಾಯಿಸಿ

See Module:college color/data.

Team123Contrastrefs
1/22/33/11/w1/b
Abilene Christian Wildcats12.161.58.1212.161.73
Air Force Falcons11.542.434.7511.541.82
Akron Zips16.054.083.9316.051.31
Alabama A&M Bulldogs
aka Alabama A&M Lady Bulldogs
13.42211.5613.421.56
Alabama Crimson TideX7.97.92.66
Alabama State Hornets212.628.03211
Alabama–Huntsville Chargers
aka UAH Chargers
9.514.671.549.52.21
Alaska Anchorage Seawolves8.531.595.358.532.46
Alaska Nanooks
aka Alaska-Fairbanks Nanooks
6.571.54.386.573.2
Albany Great Danes10.792.055.2710.791.95
Alcorn State Braves
aka Alcorn State Lady Braves
10.792.923.710.791.95
American Eagles
aka American University Eagles
10.45.571.8710.42.02
American International Yellow Jackets
aka AIC Yellow Jackets
211.7312.12211
Amherst Lord JeffsX15.8315.831.33
Angelo State Rams7.611.674.567.612.76
Appalachian State Mountaineers15.911.5110.5215.911.32
Arizona State Sun Devils8.741.794.878.742.4
Arizona Wildcats7.5715.472.047.572.77
Arkansas Razorbacks7.74212.717.742.71
Arkansas State Red Wolves5.76213.655.763.65
Arkansas Tech Wonder Boys
aka Arkansas Tech Cotton Blossoms
9.11.496.19.12.31
Arkansas-Pine Bluff Golden Lions
aka Arkansas–Pine Bluff Golden Lions
211.8911.09211
Arkansas–Little Rock Trojans
aka Little Rock Trojans
aka UALR Trojans
10.52.364.4610.52
Arkansas–Monticello Boll Weevils
aka Arkansas–Monticello Cotton Blossoms
3.8215.523.85.52
Army Black Knights
aka Army Cadets
211.811.66211
Auburn Tigers
aka Alabama Polytechnic Tigers
aka Auburn Plainsmen
15.793.155.0115.791.33
Austin Peay Governors
aka Austin Peay Lady Govs
aka Austin Peay State Lady Govs
aka Austin Peay State Governors
5.84213.595.843.59
BYU–Hawaii Seasiders7.893.622.187.892.66
Baker Wildcats13.582.824.8213.581.55
Ball State Cardinals6.616.32.476.63.18
Baylor Bears
aka Baylor Lady Bears
14.651.539.614.651.43
Belmont Bruins14.425.532.6114.421.46
Bemidji State Beavers9.79212.159.792.15
Bentley Falcons214.94.29211
Bethany Swedes10.61.467.2510.61.98
Bethel Threshers7.743.362.317.742.71
Bethune-Cookman Wildcats11.131.875.9511.131.89
Binghamton Bearcats8.26212.548.262.54
Birmingham–Southern Panthers
aka Birmingham-Southern
213.046.91211
Boise State Broncos11.773.23.6811.771.78
Boston College Eagles12.1226.0612.121.73
Boston University Terriers5.89213.575.893.57
Bowling Green Falcons12.282.734.512.281.71
Bradley Braves8.08212.68.082.6
Brigham Young University Cougars
aka Brigham Young Cougars
aka BYU Cougars
15.442.147.2115.441.36
Brown Bears15.744.853.2515.741.33
Bryant Bulldogs16.32.795.8416.31.29
Bucknell Bison12.983.064.2412.981.62
Buffalo BullsX6.536.533.21
Butler Bulldogs14.525.742.5314.521.45
CCNY Beavers6.74213.126.743.12
Cal Poly Mustangs13.041.2610.3613.041.61
Cal Poly Pomona Broncos9.762.773.529.762.15
Cal State Bakersfield Roadrunners6.671.454.66.673.15
Cal State Dominguez Hills Toros10.181.875.4310.182.06
Cal State East Bay Pioneers3.52215.975.973.52
Cal State Fullerton Titans15.063.224.6715.061.39
Cal State Los Angeles Golden Eagles211.4914.08211
Cal State Northridge Matadors5.63213.735.633.73
California Golden Bears16.541.5610.616.541.27
California Vulcans4.89214.294.894.29
Cameron Aggies211.7212.22211
Campbell Fighting Camels
aka Campbell Lady Camels
212.967.09211
Canisius Golden Griffins14.551.718.5114.551.44
Carlisle Indians7.312.033.597.312.87
Carnegie Tech Tartans
aka Carnegie Mellon Tartans
8.929.441.068.922.35
Catawba Indians3.786.081.613.785.56
Centenary Gentlemen
aka Centenary Gents
8.83212.388.832.38
Central Arkansas Bears
aka Central Arkansas Sugar Bears
10.433.522.9610.432.01
Central Connecticut Blue Devils9.221.595.819.222.28
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.21.526.710.22.06
Central Washington Wildcats7.5614.281.897.562.78
Centre Colonels
aka Centre Praying Colonels
211.5113.89211
Chadron State Eagles13.02211.6113.021.61
Charleston Golden Eagles7.871.455.437.872.67
Charleston Southern Buccaneers14.642.835.1714.641.43
Charlotte 49ers6.213.631.716.213.38
Chattanooga Mocs
aka Chattanooga Lady Mocs
11.812.125.5811.811.78
Chicago Maroons10.954.542.4110.951.92
Chicago State Cougars6.79213.096.793.09
Cincinnati Bearcats2154.2211
Citadel Bulldogs
aka The Citadel Bulldogs
12.833.393.7812.831.64
Clarkson Golden Knights9.351.456.449.352.25
Clemson Tigers
aka Clemson Lady Tigers
3.110.263.323.16.78
Cleveland State Vikings6.63213.176.633.17
Coastal Carolina Chanticleers5.894.771.245.893.57
Colby Mules13.341.419.4713.341.57
Colgate Raiders8.98212.348.982.34
College of Charleston Cougars13.423.234.1513.421.56
Colorado Buffaloes211.9410.8211
Colorado College Tigers21210.51211
Colorado Mines Orediggers13.032.086.2513.031.61
Colorado State Rams8.882.513.548.882.36
Columbia Lions2.467.953.232.468.53
Connecticut Huskies19.024.853.9319.021.1
Coppin State Eagles7.311.54.877.312.87
Cornell Big Red6.815.912.346.83.09
Creighton Bluejays15.026.772.2215.021.4
Cumberland Phoenix
aka Cumberland Bulldogs
8.84212.378.842.37
Dartmouth Big Green
aka Dartmouth Indians
6.8213.096.83.09
Davidson Wildcats215.883.57211
Dayton Flyers8.785.551.588.782.39
DePaul Blue Demons6.384.851.326.383.29
DePauw Tigers17.281.4811.6617.281.22
Delaware Fightin' Blue Hens7.671.455.297.672.74
Delaware State Hornets4.562.791.634.564.61
Delta State Statesmen5.81213.615.813.61
Denver Pioneers8.814.691.888.812.38
Detroit Titans7.1412.951.817.142.94
Drake Bulldogs10.032.853.5210.032.09
Drexel Dragons14.651.589.314.651.43
Dubuque Spartans12.982.854.5512.981.62
Duke Blue Devils
aka Trinity Blue and White
10.1315.131.4910.132.07
Duquesne Dukes16.546.62.5116.541.27
Earlham QuakersX10.3910.392.02
East Carolina Pirates9.891.566.359.892.12
East Central Tigers213.256.46211
East Tennessee State Buccaneers
aka East Tennessee State Lady Buccaneers
16.541.5610.616.541.27
Eastern Arizona Gila MonstersX15.6415.641.34
Eastern Illinois Panthers10.641.895.6310.641.97
Eastern Kentucky Colonels11.952.335.1211.951.76
Eastern Michigan Eagles7.12212.957.122.95
Eastern New Mexico Greyhounds7.127.117.122.95
Eastern Washington Eagles8.27212.548.272.54
Elon Phoenix12.122.724.4612.121.73
Emory & Henry Wasps
aka Emory and Henry Wasps
10.652.134.9910.651.97
Emory Eagles13.342.764.8313.341.57
Emporia State Hornets
aka Emporia State Lady Hornets
213.036.93211
Erskine Flying Fleet8.081.45.788.082.6
Evansville Purple Aces11.292.82411.291.86
Fairfield Stags16.34.343.7616.31.29
Fairleigh Dickinson Knights7.749.591.247.742.71
Ferris State Bulldogs5.811.513.845.813.62
Florida A&M Rattlers4.852.621.854.854.33
Florida Atlantic Owls
aka FAU Owls
12.615.892.1412.611.67
Florida Gators11.933.533.3811.931.76
Florida Gulf Coast Eagles13.254.52.9513.251.58
Florida International Golden Panthers
aka Florida International Panthers
aka FIU Golden Panthers
aka FIU Panthers
16.563.265.0816.561.27
Florida State Seminoles9.211.944.759.212.28
Fordham Rams8.981.924.688.982.34
Fort Hays State Tigers212.0110.45211
Fort Valley State Wildcats11.852.055.7811.851.77
Fresno State Bulldogs6.0412.952.146.043.48
Friends Falcons7.488.461.137.482.81
Furman Paladins
aka Furman Purple Hurricane
aka Furman Hornets
9.992.384.29.992.1
Gallaudet Bison9.81.466.719.82.14
Gardner–Webb Runnin' Bulldogs7.5212.87.52.8
George Mason Patriots7.121.514.737.122.95
George Washington Colonials13.261.459.1213.271.58
Georgetown Hoyas15.431.868.2815.431.36
Georgetown Tigers212.947.15211
Georgia Bulldogs
aka Georgia Lady Bulldogs
4.8714.282.934.874.32
Georgia Southern Eagles17.623.634.8617.621.19
Georgia State Panthers9.835.891.679.832.14
Georgia Tech Yellow Jackets
aka Georgia Tech Golden Tornado
aka Georgia Tech Engineers
2.7415.345.62.747.67
Gonzaga Bulldogs12.985.812.2312.981.62
Grambling State Tigers17.582.028.7217.581.19
Grand Canyon Antelopes10.23212.0510.232.05
Grand Valley State Lakers10.6211.9810.61.98
Grantham TalonsX8.7612.611.67
Green Bay Phoenix
aka UW-Green Bay Phoenix
7.125.11.47.122.95
Grinnell Pioneers16.34.123.9616.31.29
Hampton Pirates7.742.612.977.742.71
Harding Bisons211.9810.58211
Hardin–Simmons Cowboys8.411.515.568.412.5
Hartford Hawks5.89213.575.893.57
Hartwick HawksX7.437.432.83
Harvard Crimson7.4816.672.237.482.81
Hawaii Rainbow Warriors
aka Hawaii Warriors
aka Hawaii Rainbows
aka Hawaii Rainbow Wahine
10.78211.9510.781.95
Hawaii–Hilo Vulcans
aka Hawaii-Hilo Vulcans
5.11214.115.114.11
Henderson State Reddies
aka Henderson-Brown Reddies
7.74212.717.742.71
High Point Panthers15.183.893.915.181.38
Hobart Statesmen12.172.964.1112.171.73
Hofstra Pride10.951.567.0310.951.92
Holy Cross Crusaders9.42.144.49.42.23
Houston Baptist Huskies7.823.951.987.822.69
Houston Cougars5.421.972.755.423.87
Howard Bison11.764.642.5311.761.79
Humboldt State Lumberjacks6.721.564.316.723.12
IPFW Mastodons10.192.783.6710.192.06
IUPUI Jaguars10.732.83.8310.731.96
Idaho State Bengals212.767.6211
Idaho Vandals20.953.046.8920.951
Illinois College Blueboys
aka Illinois College Lady Blues
9.353.52.679.352.25
Illinois Fighting Illini3.9514.523.683.955.32
Illinois State Redbirds5.63213.735.633.73
Incarnate Word Cardinals5.15214.085.154.08
Indiana Hoosiers10.731.437.5110.731.96
Indiana State Sycamores8.38212.518.382.51
Iona Gaels9.962.014.969.962.11
Iowa Hawkeyes211.4714.27211
Iowa State Cyclones7.431.564.777.432.82
Ithaca Bombers13.287.991.6613.281.58
Jackson State Tigers16.053.364.7816.051.31
Jacksonville Dolphins9.682.513.859.682.17
Jacksonville State Gamecocks5.89213.575.893.57
James Madison Dukes13.2426.6213.241.59
Johns Hopkins Blue Jays212.448.62211
Johnson C. Smith Golden Bulls13.911.489.3913.911.51
Kansas Jayhawks7.284.731.547.282.89
Kansas State Wildcats
aka Kansas State Aggies
10.452.414.3410.452.01
Kansas Wesleyan Coyotes9.991.566.49.992.1
Kennesaw State Owls211.5913.17211
Kent State Golden Flashes14.372.037.0614.371.46
Kentucky Wildcats
aka Kentucky State College Wildcats
10.61.666.3810.61.98
La Salle Explorers13.461.668.113.461.56
Lafayette Leopards9.28212.269.282.26
Lake Superior State Lakers7.661.594.817.662.74
Lamar Cardinals
aka Lamar Lady Cardinals
6.0916.32.686.093.45
Langston Lions11.843.093.8311.841.77
Lehigh Mountain Hawks12.922.295.6312.921.63
Liberty Flames
aka Liberty Lady Flames
8.9215.131.78.922.35
Lincoln Blue Tigers15.313.324.6115.311.37
Lindenwood Lions
aka Lindenwood Lady Lions
21210.5211
Lipscomb Bisons
aka Lipscomb Lady Bisons
14.441.987.2914.441.45
Long Beach State 49ers
aka Long Beach State Dirtbags
211.5713.35211
Long Island Blackbirds
aka LIU Brooklyn Blackbirds
16.31.739.4216.31.29
Longwood Lancers16.542.586.4116.541.27
Louisiana State Tigers
aka LSU Lady Tigers
aka LSU Tigers
12.161.488.2312.161.73
Louisiana Tech Bulldogs11.84.762.4811.81.78
Louisiana Tech Lady Techsters2.974.721.592.977.08
Louisiana–Lafayette Ragin' Cajuns
aka Louisiana-Lafayette Ragin' Cajuns
aka Southwestern Louisiana Bulldogs
aka Louisiana Ragin' Cajuns
aka Southwestern Louisiana Ragin' Cajuns
5.5620.533.695.563.77
Louisiana–Monroe Warhawks
aka Northeast Louisiana State Indians
aka Louisiana–Monroe Indians
aka Louisiana-Monroe Indians
aka Northeast Louisiana Indians
aka ULM Warhawks
aka Louisiana-Monroe Warhawks
9.072.763.299.072.31
Louisville Cardinals7.56212.787.562.78
Lourdes Gray Wolves3.09216.793.096.79
Loyola Greyhounds6.711.644.096.713.13
Loyola Marymount Lions8.9815.591.748.982.34
Loyola Ramblers12.952.136.0812.951.62
MIT Engineers4.131.882.27.492.8
Maine Black Bears12.831.58.5612.831.64
Manhattan Jaspers
aka Manhattan Lady Jaspers
6.213.126.213.38
Manitoba Bisons6.361.44.536.363.3
Marist Red Foxes5.8816.32.775.883.57
Marquette Golden Eagles
aka Marquette Golden Avalanche
aka Marquette Warriors
12.611.518.3412.611.67
Marshall Thundering Herd3.8916.34.193.895.4
Maryland Eastern Shore Hawks
aka UMES Hawks
9.343.332.89.342.25
Maryland Terrapins3.9213.983.575.883.57
McGill RedmenX445.25
McNeese State Cowboys
aka McNeese State Cowgirls
7.841.455.47.842.68
McPherson Bulldogs5.89213.575.893.57
Memphis Tigers
aka Memphis State Tigers
11.813.393.4811.811.78
Mercer Bears
aka Mercer Baptists
214.394.78211
Mercyhurst Lakers7.1212.611.777.122.95
Merrimack Warriors18.681.4213.1518.681.12
Metro State Roadrunners9.925.421.839.922.12
Miami Hurricanes9.592.873.349.592.19
Miami RedHawks6.53213.216.533.21
Michigan State Spartans
aka Michigan Agricultural Aggies
10.752.624.110.751.95
Michigan Tech Huskies211.4914.08211
Michigan Wolverines15.061.529.8915.061.39
Middle Tennessee State Blue Raiders
aka Middle Tennessee Blue Raiders
5.5716.32.935.573.77
Midwestern State Mustangs8.982.054.388.982.34
Millsaps Majors15.761.619.8115.761.33
Milwaukee Panthers211.6812.53211
Minnesota Golden Gophers11.41.517.5711.41.84
Minnesota Morris Cougars9.262.363.929.262.27
Minnesota State Mavericks
aka MSU-Mankato Mavericks
aka Minnesota State–Mankato Mavericks
aka Mankato State Mavericks
14.791.3111.3114.791.42
Minnesota–Duluth Bulldogs11.41.517.5711.41.84
Minot State Beavers7.345.811.267.342.86
Mississippi College Choctaws13.462.016.713.461.56
Mississippi Rebels
aka Mississippi Flood
aka Ole Miss Rebels
14.525.882.4714.521.45
Mississippi State Bulldogs
aka Mississippi State Maroons
aka Mississippi A&M Aggies
X13.4213.421.56
Mississippi Valley State Delta Devils6.725.881.146.723.12
Missouri S&T Miners5.482.162.545.483.83
Missouri Southern Lions6.821.524.56.823.08
Missouri State Bears
aka Missouri State Lady Bears
14.1918.561.3114.191.48
Missouri Tigers14.282.795.1214.281.47
Missouri Western Griffons16.31.6210.0416.31.29
Monmouth Hawks16.542.376.9916.541.27
Montana Grizzlies
aka Montana Lady Griz
14.063.294.2814.061.49
Montana State Bobcats15.473.24.8315.471.36
Morehead State Eagles6.791.484.586.793.09
Morgan State Bears9.652.753.519.652.18
Mount St. Mary's Mountaineers12.944.532.8612.941.62
Mount Union Purple RaidersX11.9911.991.75
Murray State Racers
aka Murray State Thoroughbreds
16.142.018.0516.141.3
NJIT Highlanders5.8916.392.785.893.57
NYIT Bears10.54.892.15210.5
NYU Violets
aka New York University Violets
X11.611.61.81
Navy Midshipmen15.4727.7215.471.36
Nebraska Cornhuskers4.5218.884.174.644.52
Nebraska–Kearney Lopers11.922.84.2511.921.76
Nevada Wolf Pack
aka Nevada Sagebrushers
12.612.854.4312.611.67
New Hampshire Wildcats10.952.384.610.951.92
New Mexico Lobos6.671.693.946.673.15
New Mexico State Aggies9.37212.249.372.24
New Orleans Privateers
aka UNO Privateers
6.742.382.846.743.12
Niagara Purple Eagles9.991.675.969.992.1
Nicholls State Colonels7.53.682.047.52.8
Norfolk State Spartans5.251.952.695.254
North Alabama Lions13.232.345.6613.231.59
North Carolina A&T Aggies9.511.735.59.512.21
North Carolina Central EaglesX8.548.542.46
North Carolina State Wolfpack
aka North Carolina A&M Aggies
aka NC State Wolfpack
5.89213.575.893.57
North Carolina Tar Heels2.3514.526.172.358.92
North Dakota Fighting Hawks
aka North Dakota Fighting Sioux
aka North Dakota
3.68215.713.685.71
North Dakota State Bison8.711.555.628.712.41
North Florida Ospreys14.341.4110.1614.341.46
North Texas Mean Green
aka North Texas Eagles
4.7516.33.434.754.42
Northeastern Huskies5.89213.575.893.57
Northeastern State RiverHawks8.532.852.998.532.46
Northern Arizona Lumberjacks12.481.518.2512.481.68
Northern Colorado Bears11.441.896.0611.441.84
Northern Illinois Huskies
aka NIU Huskies
5.89213.575.893.57
Northern Iowa Panthers13.052.056.3713.051.61
Northern Kentucky Norse211.5613.46211
Northern Michigan Wildcats9.11.595.719.12.31
Northwest Missouri State Bearcats6.621.923.446.623.17
Northwestern Oklahoma State Rangers215.763.65211
Northwestern State Demons
aka Northwestern State Lady Demons
8.412.942.868.412.5
Northwestern Wildcats10.561.975.3610.561.99
Notre Dame Fighting Irish15.792.655.9515.791.33
Nova Southeastern Sharks10.575.272.0110.571.99
Oakland Golden Grizzlies212.727.72211
Oglethorpe Stormy Petrels211.3515.59211
Ohio Bobcats6.711.793.756.713.13
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 Sooners9.961.069.359.962.11
Oklahoma State Cowboys
aka Oklahoma A&M Aggies
aka Oklahoma State Cowgirls
3.77215.573.775.57
Oklahoma Wesleyan Eagles16.397.742.1216.391.28
Old Dominion Monarchs
aka Old Dominion Lady Monarchs
9.223.342.769.222.28
Omaha Mavericks
aka Nebraska–Omaha Mavericks
aka UNO Mavericks
215.194.05211
Oral Roberts Golden Eagles13.331.976.7513.331.58
Oregon Ducks
aka Oregon Webfoots
7.441.315.677.442.82
Oregon State Beavers
aka Oregon Agricultural Aggies
213.16.78211
Ottawa Braves16.32.018.1116.31.29
Ouachita Baptist Tigers10.21.576.4910.22.06
Pacific Tigers213.845.48211
Penn Quakers
aka Pennsylvania Quakers
15.578.921.7515.571.35
Penn State Nittany Lions
aka Penn State Lady Lions
X13.5313.531.55
Pepperdine Waves15.432.95.3315.431.36
Peru State BobcatsX3.833.835.48
Pittsburg State Gorillas5.741.473.95.743.66
Pittsburgh Panthers
aka Pitt Panthers
13.961.957.1513.961.5
Plymouth State Panthers8.89212.368.892.36
Point Skyhawks10.431.556.710.432.01
Portland Pilots14.514.92.9614.511.45
Portland State Vikings10.592.34.610.591.98
Prairie View Panthers
aka Prairie View A&M Panthers
15.761.5110.4615.761.33
Presbyterian Blue Hose6.477.741.26.473.25
Princeton Tigers16.32.915.616.31.29
Providence Friars213.346.29211
Purdue Boilermakers211.9410.84211
Quinnipiac Bobcats15.793.324.7515.791.33
RIT Tigers1.827.063.8811.551.82
RPI Engineers
aka Rensselaer Engineers
4.6815.913.44.684.49
Radford Highlanders6.3411.141.766.343.31
Regina Rams9.731.556.289.732.16
Rhode Island Rams
aka University of Rhode Island Rams
2.2916.057.012.299.17
Rice Owls14.426.312.2814.421.46
Richmond Spiders17.628.921.9817.621.19
Rider Broncs8.185.071.618.182.57
Robert Morris Colonials
aka RMU Colonials
15.317.52.0415.311.37
Rockhurst HawksX7.27.22.92
Rutgers Scarlet Knights5.81213.625.813.62
SIU Edwardsville Cougars5.89213.575.893.57
Sacramento State Hornets12.972.515.1612.971.62
Sacred Heart Pioneers6.615.132.296.63.18
Saginaw Valley State Cardinals8.9212.31.388.922.35
Saint Francis Red Flash6.2213.396.23.39
Saint Joseph's Hawks8.488.261.038.482.48
Saint Louis Billikens9.51.665.729.52.21
Saint Mary Spires15.791.4610.8115.791.33
Saint Mary's Gaels13.145.322.4713.141.6
Saint Peter's Peacocks
aka Saint Peter's Peahens
14.284.892.9214.281.47
Sam Houston State Bearkats8.912.373.758.912.36
Samford Bulldogs
aka Howard Bulldogs
15.297.092.1615.291.37
San Diego State Aztecs6.04213.486.043.48
San Diego Toreros11.292.045.5411.291.86
San Francisco Dons91.75.2892.33
San Francisco State Gators9.421.46.729.422.23
San Jose State Spartans
aka San José State Spartans
7.442.113.537.442.82
Santa Clara Broncos6.992136.993
Saskatchewan HuskiesX9.69.62.19
Savannah State Lady Tigers
aka Savannah State Tigers
4.3112.542.914.314.87
Seattle Redhawks7.75212.717.752.71
Seton Hall Pirates9.623.342.889.622.18
Sewanee Tigers9.991.735.779.992.1
Siena Saints6.931.624.286.933.03
Simon Fraser Clan13.756.042.2813.751.53
South Alabama Jaguars15.476.282.4615.471.36
South Carolina Gamecocks12.12211.7312.121.73
South Carolina State Bulldogs7.312.611.737.32.88
South Dakota Coyotes7.56212.787.562.78
South Dakota State Jackrabbits10.691.467.3210.691.96
South Florida Bulls6.931.753.956.933.03
Southeast Missouri State Redhawks5.88213.575.883.57
Southeastern Louisiana Lions
aka Southeastern Louisiana Lady Lions
7.342.053.587.342.86
Southeastern Oklahoma State Savage Storm10.61.357.8710.61.98
Southern Arkansas Muleriders9.51.466.59.52.21
Southern Connecticut State OwlsX14.2214.221.48
Southern Illinois Salukis13.42211.5613.421.56
Southern Jaguars
aka Southern University Jaguars
aka Southern Lady Jaguars
11.851.567.5911.851.77
Southern Methodist University Mustangs
aka SMU Mustangs
6.019.831.646.013.5
Southern Miss Golden Eagles
aka Southern Miss Lady Eagles
211.5613.48211
Southern Nazarene Crimson Storm13.22211.5913.221.59
Southern Utah Thunderbirds6.05213.476.053.47
Southwest Baptist Bearcats11.61.726.7411.61.81
Southwest Minnesota State Mustangs16.433.035.4216.431.28
Southwestern Moundbuilders7.2212.927.22.92
Southwestern Oklahoma State Bulldogs12.123.433.5412.121.73
St. Bonaventure Bonnies12.581.757.1812.581.67
St. Cloud State Huskies5.61213.755.613.75
St. Francis Brooklyn Terriers9.855.631.759.852.13
St. John's Red Storm5.5817.373.115.583.77
St. Lawrence SaintsX6.896.893.05
Stanford Cardinal
aka Stanford
aka Stanford Indians
9.42.134.419.42.23
Stephen F. Austin Lumberjacks
aka Stephen F. Austin Ladyjacks
9.332.14.459.332.25
Sterling Warriors7.616.542.187.62.76
Stetson Hatters6.93213.036.933.03
Stillman Tigers17.621.839.6517.621.19
Stony Brook Seawolves8.929.521.078.922.35
Syracuse Orange
aka Syracuse Orangemen
4.5216.833.734.524.65
TCU Horned Frogs12.132.385.112.131.73
Tabor Bluejays12.981.58.6412.981.62
Tarleton State Texans
aka Tarleton State TexAnns
10.43212.0110.432.01
Temple Owls8.7415.911.828.742.4
Tennessee State Tigers
aka Tennessee State Lady Tigers
7.675.231.477.672.74
Tennessee Tech Golden Eagles10.371.516.8610.372.02
Tennessee Volunteers
aka Tennessee Lady Volunteers
8.45212.492.498.45
Tennessee–Martin Skyhawks
aka Tennessee-Martin Skyhawks
15.292.635.8215.291.37
Texas A&M AggiesX15.6615.661.34
Texas A&M–Commerce Lions
aka Texas A&M-Commerce Lions
15.472.057.5515.471.36
Texas A&M–Corpus Christi Islanders5.615.121.15.613.75
Texas A&M–Kingsville Javelinas10.61.566.7910.61.98
Texas Longhorns4.5913.022.844.594.58
Texas Southern Tigers
aka Texas Southern Lady Tigers
10.392.364.410.392.02
Texas State Bobcats14.614.483.2614.611.44
Texas Tech Red Raiders
aka Texas Tech Lady Raiders
5.89213.575.893.57
Texas Woman's Pioneers10.16212.0710.162.07
Texas-Arlington Mavericks
aka Texas–Arlington Mavericks
aka UT Arlington Mavericks
6.072.632.316.073.46
Toledo Rockets14.31.499.5914.31.47
Towson Tigers211.5113.89211
Transylvania Pioneers
aka Kentucky University Pioneers
X8.928.922.35
Trinity Tigers8.925.741.558.922.35
Troy Trojans8.983.342.698.982.34
Truman Bulldogs10.2416.31.5910.242.05
Tufts Jumbos12.13.433.5312.11.73
Tulane Green Wave
aka Tulane Olive and Blue
14.253.733.8214.251.47
Tulsa Golden Hurricane12.985.882.2112.981.62
Tuskegee Golden Tigers11.21.746.4511.21.88
UAB Blazers6.41.723.736.43.28
UBC Thunderbirds6.081.553.916.083.45
UC Davis Aggies14.642.655.5114.641.43
UC Irvine Anteaters15.791.5610.1215.791.33
UC Riverside Highlanders5.231.992.635.234.02
UC San Diego Tritons14.181.59.4514.181.48
UC Santa Barbara Gauchos
aka UCSB Gauchos
14.861.798.2814.861.41
UC Santa Cruz Banana Slugs9.421.855.19.422.23
UCF Knights212.628.02211
UCLA Bruins4.821.792.694.824.35
UConn HuskiesX19.0219.021.1
UIC Flames15.425.422.8515.421.36
UMBC Retrievers211.6212.98211
UMKC Kangaroos6.381.554.16.383.29
UMSL Tritons6.851.913.596.853.07
UMass Lowell River Hawks7.585.381.417.582.77
UMass Minutemen
aka Massachusetts Minutewomen
aka Massachusetts Minutemen
aka UMass Minutewomen
9.42212.239.422.23
UNC Asheville Bulldogs10.98211.9110.981.91
UNC Greensboro Spartans12.611.518.3412.611.67
UNC Wilmington Seahawks6.791.414.816.793.09
UNLV Rebels
aka UNLV Lady Rebels
aka UNLV Runnin' Rebels
7.295.741.277.292.88
USC Trojans8.921.515.98.922.35
USC Upstate Spartans6.72213.126.723.12
UTEP Miners
aka Texas Western Miners
16.053.195.0316.051.31
UTPA Broncs9.722.873.399.722.16
UTRGV Vaqueros
aka Texas–Rio Grande Valley Vaqueros
14.343.574.0114.341.46
UTSA Roadrunners15.793.374.6815.791.33
UW–Eau Claire Blugolds9.8624.949.862.13
Union Dutchmen
aka Union Dutchwomen
X9.349.342.25
Utah State Aggies15.772.925.3915.771.33
Utah Utes5.89213.575.893.57
Utah Valley Wolverines10.982.474.4410.981.91
VCU Rams211.7112.28211
VMI Keydets7.361.734.267.362.85
Valdosta State Blazers5.89213.575.893.57
Valparaiso Crusaders15.441.5110.2115.441.36
Vanderbilt Commodores213.855.46211
Vermont Catamounts8.981.625.558.982.34
Villanova Wildcats15.472.386.515.471.36
Virginia Cavaliers14.942.955.0614.941.41
Virginia Tech Hokies
aka VPI Fighting Gobblers
aka Virginia Tech Fighting Gobblers
13.422.944.5713.421.56
Wagner Seahawks11.371.617.0811.371.85
Wake Forest Demon Deacons213.825.5211
Washburn IchabodsX14.6914.691.43
Washington Huskies10.221.476.9410.222.06
Washington State Cougars8.185.561.478.182.57
Washington University Bears
aka WUSTL Bears
7.745.81.347.742.71
Washington and Jefferson Presidents
aka Washington & Jefferson Presidents
7.11212.957.112.95
Washington and Lee Generals
aka Washington & Lee Generals
X10.8610.861.93
Wayne State Warriors7.612.762.767.612.76
Weber State Wildcats12.277.941.5412.271.71
Wesleyan Cardinals6.15213.416.153.41
West Alabama TigersX445.25
West Liberty State HilltoppersX19.56211
West Texas A&M Buffaloes13.47211.5613.471.56
West Virginia Mountaineers14.642.057.1414.641.43
Western Carolina Catamounts9.812.753.579.812.14
Western Illinois Leathernecks8.411.515.568.412.5
Western Kentucky Hilltoppers
aka WKU Lady Toppers
aka WKU Hilltoppers
6.87213.066.873.06
Western Michigan Broncos10.32.613.9410.32.04
Western Ontario MustangsX9.429.422.23
Western Oregon WolvesX445.25
Wichita State Shockers
aka Fairmount Shockers
211.513.98211
Widener Pride
aka Widener Pioneers
6.871.544.456.873.06
Willamette BearcatsX2.875.843.59
William & Mary Tribe
aka William and Mary Tribe
8.531.884.548.532.46
William Smith HeronsX8.418.412.5
Williams Ephs10.091.466.9110.092.08
Windsor Lancers13.751.489.3113.751.53
Winthrop Eagles7.91.515.257.92.66
Wisconsin Badgers8.42212.498.422.49
Wisconsin–Whitewater Warhawks10.381.95.4510.382.02
Wofford Terriers214.794.38211
Wright State Raiders6.192.232.786.193.39
Wyoming Cowboys
aka Wyoming Cowgirls
12.241.597.6812.241.72
Xavier Musketeers
aka Saint Xavier Saints
aka St. Xavier Saints
13.152.425.4413.151.6
Yale BulldogsX12.212.21.72
York Panthers9.16212.299.162.29
Youngstown State Penguins5.88213.575.883.57
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 = "Module: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( origc )
	local c = stripwhitespace(origc 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 )

		return 0.2126 * R + 0.7152 * G + 0.0722 * B
	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 )

		return 0.2126 * R + 0.7152 * G + 0.0722 * B
	end

	-- failure
	error('Invalid hex color ' .. origc, 2)
end

local function remove_sport(team)
	team = mw.ustring.gsub(team, "%s*<[Bb][Rr][^<>]*>%s*", ' ');
	team = mw.ustring.gsub(team, " [Tt]eam$", '')
	team = mw.ustring.gsub(team, " [Bb]asketball$", '')
	team = mw.ustring.gsub(team, " [Bb]aseball$", '')
	team = mw.ustring.gsub(team, " [Cc]ross [Cc]ountry$", '')
	team = mw.ustring.gsub(team, " [Ff]ield [Hh]ockey$", '')
	team = mw.ustring.gsub(team, " [Ff]ootball$", '')
	team = mw.ustring.gsub(team, " [Gg]olf$", '')
	team = mw.ustring.gsub(team, " [Gg]ymnastics$", '')
	team = mw.ustring.gsub(team, " [Ii]ce [Hh]ockey$", '')
	team = mw.ustring.gsub(team, " [Ll]acrosse$", '')
	team = mw.ustring.gsub(team, " [Rr]owing$", '')
	team = mw.ustring.gsub(team, " [Ss]ki$", '')
	team = mw.ustring.gsub(team, " [Ss]occer$", '')
	team = mw.ustring.gsub(team, " [Ss]oftball$", '')
	team = mw.ustring.gsub(team, " [Ss]wim$", '')
	team = mw.ustring.gsub(team, " [Tt]ennis$", '')
	team = mw.ustring.gsub(team, " [Tt]rack [Aa]nd [Ff]ield$", '')
	team = mw.ustring.gsub(team, " [Vv]olleyball$", '')
	team = mw.ustring.gsub(team, " [Ww]restling$", '')
	team = mw.ustring.gsub(team, " [Ww]omen's$", '')
	team = mw.ustring.gsub(team, " [Mm]en's$", '')

	return team
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) .. ';'
	-- remove the border if it's nearly white
	if ((1 + 0.05)/(color2lum(color) + 0.05) < 1.25) then
		borderwidth = '0'
	end
	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) .. ';'
	-- remove the border if it's nearly white
	if ((1 + 0.05)/(color2lum(color) + 0.05) < 1.25) then
		borderwidth = '0'
	end
	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, borderwidth)
	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

	local style
	if( background == 'FFFFFF' ) then
		style = 'background-color:none;color:#' .. fontcolor .. ';'
	else
		style = 'background-color:#' .. background .. ';color:#' .. fontcolor .. ';'
	end

	if borderwidth then
		borderwidth = tonumber(borderwidth or '2') or 0
		local bordercolor = (colors[3] or colors[2] or 'FFFFFF'):upper()
		if (borderwidth > 0 and bordercolor ~= 'FFFFFF') then
			-- do not add a border if it's nearly white
			if ((1 + 0.05)/(color2lum(bordercolor) + 0.05) >= 1.25) then
				style = style .. ' border:' .. borderwidth .. 'px solid #' .. bordercolor .. ';'
			end
		end
	end
	return style
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_table_head(args, team, ctype)
	local colors = get_colors(team, nil)
	-- set the default background
	local background = (ctype == 'p') and
		(colors[1] or 'FFFFFF'):upper() or
		(colors[3] or colors[2] or 'FFFFFF'):upper()
	-- 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
	local s = 'background-color:#' .. background .. ';color:#' .. fontcolor .. ';'

	local res = '|-\n'
	for i=1,50 do
		if( args[i] ~= nil ) then
			local cstyle = 'scope="col" style="' .. s .. '"'
			if args['col' .. i .. 'span'] ~= nil then
				cstyle = cstyle .. ' colspan=' .. args['col' .. i .. 'span']
			end
			res = res .. '! ' .. cstyle .. ' |' .. args[i] .. '\n'
		else
			return res .. '|-\n'
		end
	end
	return res .. '<span class="error">Error!</span>\n|-\n'

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_boxes(frame, team, order, sep)
	local function colorbox( h )
		local r = mw.html.create('')
		r:tag('span')
			:css('background-color', '#' .. (h or ''))
			:css('border', '1px solid #000')
			:wikitext('&nbsp;&nbsp;&nbsp;&nbsp;')
		return tostring(r)
	end

	local colors = get_colors(team, 'unknown')

	if type(colors) ~= 'table' then
		return ''
	end

	local colorboxes = {}
	local colororder = {'1','2','3','4','5'}
	local namecheck = 0
	if order == '' then
		order = colors['order'] or ''
		namecheck = 1
	end
	if order ~= '' then
		colororder = mw.text.split(order, '')
	end
	for k,v in pairs(colororder) do
		local i = tonumber(v) or 0
		if(	namecheck == 0 or colors['name' .. i]) then
			if colors[i] then
				table.insert(colorboxes,colorbox(colors[i]))
			end
		end
	end

	if (#colorboxes > 0) then
		return table.concat(colorboxes, sep)
	end

	return ''
end

local function team_list(frame, team, num1, num2, num3, num4, num5, sep)
	local function colorbox( h )
		local r = mw.html.create('')
		r:tag('span')
			:css('background-color', '#' .. (h or ''))
			:css('border', '1px solid #000')
			:wikitext('&nbsp;&nbsp;&nbsp;&nbsp;')
		return tostring(r)
	end

	local colors = get_colors(team, 'unknown')

	if type(colors) ~= 'table' then
		return ''
	end

	local nums = {
		tonumber(num1:match('[1-5]') or '0') or 0,
		tonumber(num2:match('[1-5]') or '0') or 0,
		tonumber(num3:match('[1-5]') or '0') or 0,
		tonumber(num4:match('[1-5]') or '0') or 0,
		tonumber(num5:match('[1-5]') or '0') or 0}

	local colorboxes = {}
	local colornames = {}
	local colororder = {'1','2','3','4','5'}
	local order = colors['order'] or ''
	if(order ~= '') then
		colororder = mw.text.split(order, '')
	end
	for k,v in pairs(colororder) do
		local i = tonumber(v) or 0
		if ( nums[i] > 0 ) then
			if(	colors['name' .. nums[i]]) then
				table.insert(colornames,colors['name' .. nums[i]])
				table.insert(colorboxes,colorbox(colors[nums[i]] or ''))
			end
		end
	end

	local res = ''
	if (#colornames == 1) then
		res = colornames[1]
	elseif (#colornames == 2) then
		res = colornames[1] .. '&nbsp;and&nbsp;' .. colornames[2]
	elseif (#colornames > 2) then
		res = colornames[1]
		for i=2,#colornames do
			if( i < #colornames ) then
				res = res .. ',&nbsp;' .. colornames[i]
			else
				res = res .. ',&nbsp;and&nbsp;' .. colornames[i]
			end
		end
	end

	if (colors['cite']) then
		res = res .. frame:preprocess('<ref>' .. colors['cite'] .. '</ref>')
	end
	if (colors['ref']) then
		res = res .. '[' .. colors['ref'] .. ']'
	end
	if (colors['ref2']) then
		res = res .. '[' .. colors['ref2'] .. ']'
	end

	if (#colornames > 0) then
		res = res .. sep
	end

	if (#colorboxes > 0) then
		res = res .. table.concat(colorboxes, '&nbsp;')
	end

	return res
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(remove_sport(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(remove_sport(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(remove_sport(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(remove_sport(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(remove_sport(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(remove_sport(args[1] or ''), args['border'])
end

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

function p.tablehead1(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_table_head(args, remove_sport(args['team'] or ''), 'p')
end

function p.tablehead2(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_table_head(args, remove_sport(args['team'] or ''), 's')
end

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

function p.boxes(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_boxes(frame, remove_sport(args[1] or ''),
		args['order'] or '', args['sep'] or '&nbsp;')
end

function p.list(frame)
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args
	return team_list(frame, remove_sport(args[1] or ''),
		args[2] or '1', args[3] or '2', args[4] or '3', args[5] or '4', args[6] or '5', args['sep'] or '')
end

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

function p.check_data()
	-- In a sandbox, preview {{#invoke:college color|check_data}}
	local results = {'Problems in [[Module:College color/data]]:'}
	local function problems(msg)
		if msg then
			table.insert(results, msg)
		elseif results[2] then
			return table.concat(results, '\n*')
		else
			return 'No problems detected.'
		end
	end
	local data = require(data_module)
	local keys = {}
	for k, _ in pairs(data) do
		table.insert(keys, k)
	end
	table.sort(keys)
	for _, key in ipairs(keys) do
		local val = data[key]
		if not (type(key) == 'string' and (type(val) == 'table' or type(val) == 'string')) then
			problems('Invalid type for "' .. tostring(key) .. '"')
		end
		if type(val) == 'table' then
			if not (2 <= #val and #val <= 4) then
				problems('Invalid number of numbered parameters for "' .. tostring(key) .. '"')
			end
			for i, v in ipairs(val) do
				if not tostring(v):match('^%x%x%x%x%x%x$') then
					problems('Parameter [' .. i .. '] should be a 6-hex-digit color but is "' .. tostring(v) .. '" for "' .. tostring(key) .. '"')
				end
			end
			for k, v in pairs(val) do
				if type(k) == 'number' then
					if not (1 <= k and k <= 4) then
						problems('Invalid numbered parameter for "' .. tostring(key) .. '"')
					end
				elseif type(k) == 'string' then
					if not (
							k:match('^name[1-4]$') or
							k:match('^cite2?$') or
							k:match('^order$')
							) then
						problems('Unexpected key in table for "' .. tostring(key) .. '"')
					end
				else
					problems('Invalid key type in table for "' .. tostring(key) .. '"')
				end
			end
		elseif data[val] == nil then
			problems('Undefined alias for "' .. tostring(key) .. '"')
		elseif type(data[val]) ~= 'table' then
			problems('Alias is not a table for "' .. tostring(key) .. '"')
		end
	end
	return problems()
end

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

return p