Module:College color

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}}

Nýtsla

rætta
  • {{#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

rætta

See Module:college color/data.

Test table

rætta
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.052.077.7716.051.31
Alabama A&M Bulldogs
aka Alabama A&M Lady Bulldogs
10.14212.0710.142.07
Alabama Crimson Tide7.916.32.067.92.66
Alabama State Hornets212.110.02211
Alabama–Huntsville Chargers
aka UAH Chargers
4.714.673.134.74.47
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
13.232.136.2113.231.59
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 Wildcats7.5715.472.047.572.77
Arkansas RazorbacksX7.747.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
Army Black Knights
aka Army Cadets
211.811.66211
Auburn Tigers
aka Alabama Polytechnic Tigers
aka Auburn Plainsmen
15.43.93.9515.41.36
Austin Peay Governors
aka Austin Peay Lady Govs
aka Austin Peay State Lady Govs
aka Austin Peay State Governors
X5.845.843.59
BYU–Hawaii Seasiders7.893.622.187.892.66
Baker Wildcats2.6513.535.112.657.93
Ball State Cardinals6.6213.186.63.18
Baylor Bears14.651.539.614.651.43
Belmont Bruins14.425.532.6114.421.46
Bemidji State BeaversX12.5112.511.68
Bentley Falcons214.94.29211
Bethune-Cookman Wildcats101.975.06102.1
Binghamton BearcatsX8.268.262.54
Birmingham–Southern Panthers
aka Birmingham-Southern
211.3116.02211
Bishop's Gaiters
aka Bishops Gaiters
12.222.355.212.221.72
Boise State Broncos11.773.23.6811.771.78
Boston College Eagles9.2833.099.282.26
Boston University TerriersX5.895.893.57
Bowling Green Falcons2.7312.284.52.737.7
Bradley Braves8.08212.68.082.6
Brigham Young University Cougars
aka Brigham Young Cougars
aka BYU Cougars
X15.4415.441.36
Brown Bears15.745.892.6715.741.33
Bucknell Bison3.3911.833.493.396.2
Buffalo BullsX12.9112.911.63
Butler BulldogsX14.5214.521.45
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 Titans10.122.723.7210.122.07
Cal State Northridge Matadors5.63213.735.633.73
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
Centenary Gentlemen
aka Centenary Gents
X10.9510.951.92
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
211.5113.89211
Charleston Golden Eagles7.871.455.437.872.67
Charleston Southern Buccaneers14.642.835.1714.641.43
Charlotte 49ers6.213.022.066.213.38
Chattanooga Mocs
aka Chattanooga Lady Mocs
11.812.125.5811.811.78
Chicago MaroonsX10.9510.951.92
Chicago State Cougars6.79213.096.793.09
Cincinnati Bearcats2154.2211
Citadel Bulldogs
aka The Citadel Bulldogs
3.3912.833.783.396.19 citadel.edu
Clarkson Golden Knights9.561.476.59.562.2
Clemson Tigers
aka Clemson Lady Tigers
3.110.263.323.16.78 nmnathletics.com
Cleveland State VikingsX6.636.633.17
Coastal Carolina Chanticleers4.773.741.284.774.4
Colgate RaidersX8.988.982.34
College of Charleston Cougars10.853.413.1810.851.94
Colorado Buffaloes211.9410.8211
Colorado College Tigers212.189.64211
Colorado State Rams8.771.964.478.772.4
Columbia LionsX2.292.299.17
Connecticut Huskies19.024.853.9319.021.1
Cornell Big Red6.815.912.346.83.09
Creighton BluejaysX13.0313.031.61
Cumberland Bulldogs9.05212.329.052.32
Dartmouth Big Green
aka Dartmouth Indians
6.8213.096.83.09
Davidson Wildcats217.142.94211
Dayton Flyers5.558.781.585.553.78
DePaul Blue Demons5.264.461.185.263.99
DePauw Tigers17.281.4811.6617.281.22
Delaware Fightin' Blue Hens7.671.455.297.672.74
Delaware State HornetsX3.084.574.6
Denver Pioneers8.814.691.888.812.38
Detroit Titans12.957.141.8112.951.62
Drake Bulldogs10.033.013.3410.032.09
Drexel Dragons14.651.589.314.651.43
Duke Blue Devils
aka Trinity Blue and White
X10.1310.132.07
Duquesne Dukes9.684.392.29.682.17
Earlham QuakersX10.3910.392.02
East Carolina Pirates9.891.566.359.892.12
East Central Tigers3.25216.463.256.46
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 Panthers12.713.553.5812.711.65
Eastern Kentucky Colonels11.952.335.1211.951.76
Eastern Michigan Eagles7.123.951.87.122.95
Eastern Washington Eagles8.27212.548.272.54
Elon Phoenix9.483.692.579.482.22
Emporia State Hornets
aka Emporia State Lady Hornets
16.33.035.3816.31.29
Erskine Flying Fleet8.081.45.788.082.6
Evansville Purple AcesX9.599.592.19
Ferris State Bulldogs5.811.573.695.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.373.5411.931.76
Florida Gulf Coast Eagles13.254.52.9513.251.58
Florida International Golden Panthers
aka Florida International Panthers
aka FIU Panthers
aka FIU Golden Panthers
13.532.714.9913.531.55
Florida State Seminoles9.211.944.759.212.28
Fordham RamsX9.989.982.1
Fort Hays State Tigers211.9810.59211
Fort Valley State Wildcats8.591.0788.592.44
Fresno State Bulldogs6.0412.952.146.043.48
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' Bulldogs5.44213.865.443.86
George Mason Patriots7.121.514.737.122.95
George Washington Colonials15.231.510.1815.231.38
Georgetown Hoyas16.624.243.9216.621.26
Georgetown Tigers212.947.15211
Georgia Bulldogs4.8714.282.934.874.32
Georgia Southern Eagles17.622.965.9617.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 Bulldogs13.886.792.0413.881.51
Grambling State Tigers17.582.028.7217.581.19
Grand Canyon AntelopesX10.2310.232.05
Grand Valley State Lakers10.6211.9810.61.98
Grantham TalonsX8.7612.611.67
Green Bay PhoenixX7.127.122.95
Grinnell Pioneers213.825.5211
Hampton Pirates7.742.612.977.742.71
Hardin–Simmons Cowboys8.411.515.568.412.5
Hartford HawksX5.895.893.57
Hartwick HawksX7.437.432.83
Harvard Crimson7.4816.672.237.482.81 seas.harvard.edu harvard.edu
Hawaii Warriors
aka Hawaii Rainbow Warriors
aka Hawaii Rainbows
aka Hawaii Rainbow Wahine
10.78211.9510.781.95
Henderson State Reddies
aka Henderson-Brown Reddies
7.74212.717.742.71
High Point Panthers15.183.893.915.181.38
Hobart Statesmen2.539.423.722.538.29
Hofstra Pride10.951.567.0310.951.92
Holy Cross CrusadersX7.387.382.84
Houston Baptist HuskiesX5.7914.661.43
Houston Cougars5.891.972.995.893.57
Howard Bison11.764.642.5311.761.79
IPFW Mastodons10.082.783.6310.082.08
Idaho State Bengals212.767.6211
Idaho Vandals3.0420.956.893.046.9
Illinois Fighting Illini3.9514.523.683.955.32
Illinois State RedbirdsX5.635.633.73
Incarnate Word Cardinals5.15214.085.154.08
Indiana HoosiersX7.5110.731.96
Indiana State SycamoresX8.388.382.51
Iona Gaels9.781.735.659.782.15
Iowa Hawkeyes211.3116.02211
Iowa State Cyclones7.431.564.777.432.82
Jackson State TigersX16.0516.051.31
Jacksonville Dolphins9.832.114.679.832.14
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 Jayhawks11.124.732.3511.121.89
Kansas State Wildcats
aka Kansas State Aggies
X10.4510.452.01
Kennesaw State Owls211.5113.89211
Kent State Golden Flashes14.372.037.0614.371.46
Kentucky Wildcats
aka Kentucky State College Wildcats
X6.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.138.921.715.131.39
Lincoln Blue Tigers15.313.324.6115.311.37
Lindenwood Lions
aka Lindenwood Lady Lions
20.222.059.8720.221.04
Lipscomb Bisons
aka Lipscomb Lady Bisons
14.441.987.2914.441.45
Little Rock Trojans10.52.364.4610.52
Long Beach State 49ers211.5713.35211
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-Lafayette Ragin' Cajuns
aka Louisiana Ragin' Cajuns
5.5620.533.695.563.77
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 Greyhounds6.711.644.096.713.13 loyolagreyhounds.com
Loyola Marymount Lions9.6312.791.339.632.18
Loyola Ramblers10.951.517.2410.951.92
Maine Black Bears12.831.58.5612.831.64
Manitoba Bisons6.361.44.536.363.3
Marist Red Foxes5.2817.543.325.283.98
Marquette Warriors
aka Marquette Golden Avalanche
aka Marquette Golden Eagles
12.611.518.3412.611.67
Marshall Thundering HerdX3.893.895.4
Maryland Eastern Shore Hawks
aka UMES Hawks
9.343.332.89.342.25
Maryland Terrapins4.31.472.924.34.88
Massachusetts MinutemenX10.9510.951.92
McGill RedmenX445.25
McNeese State Cowboys
aka McNeese State Cowgirls
7.41.455.17.42.84
Memphis Tigers
aka Memphis State Tigers
11.813.393.4811.811.78
Mercer Bears
aka Mercer Baptists
4.39214.784.394.78
Mercyhurst LakersX7.127.122.95
Merrimack Warriors18.681.4213.1518.681.12
Miami Hurricanes9.592.873.349.592.19
Miami RedHawksX6.536.533.21
Michigan State Spartans
aka Michigan Agricultural Aggies
X10.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
Millsaps Majors15.761.619.8115.761.33
Milwaukee Panthers211.6812.53211
Minnesota Golden Gophers11.41.517.5711.41.84
Minnesota State Mavericks
aka Mankato State Mavericks
aka MSU-Mankato Mavericks
aka Minnesota State–Mankato Mavericks
14.791.3111.3114.791.42
Minnesota–Duluth Bulldogs11.41.517.5711.41.84
Mississippi College Choctaws12.711.986.4112.711.65
Mississippi Rebels
aka Mississippi Flood
aka Ole Miss Rebels
14.525.882.4714.521.45
Mississippi State Bulldogs
aka Mississippi A&M Aggies
aka Mississippi State Maroons
13.424.48313.421.56
Mississippi Valley State Delta DevilsX7.117.112.95
Missouri S&T Miners8.841.725.148.842.38
Missouri Southern Lions6.821.524.56.823.08
Missouri State BearsX14.1914.191.48
Missouri Tigers14.282.795.1214.281.47
Missouri Western Griffons16.31.6210.0416.31.29
Monmouth HawksX17.217.21.22
Montana Grizzlies
aka Montana Lady Griz
13.022.854.5713.021.61
Montana State Bobcats13.361.887.113.361.57
Morehead State Eagles6.791.484.586.793.09
Morgan State Bears9.652.753.519.652.18
Mount Union Purple RaidersX11.9911.991.75
Mountain West ConferenceX4.7310.432.01
Murray State Racers16.142.018.0516.141.3
NJIT HighlandersX445.25
NYU Violets
aka New York University Violets
X11.611.61.81
Navy Midshipmen14.371.927.514.371.46
Nebraska CornhuskersX5.065.73.68
Nebraska–Kearney Lopers11.922.84.2511.921.76
Nevada Wolf Pack
aka Nevada Sagebrushers
12.613.973.1712.611.67
New Hampshire WildcatsX10.9510.951.92
New Mexico Lobos6.326.541.036.323.32
New Mexico State AggiesX8.858.852.37
New Orleans Privateers
aka UNO Privateers
6.742.382.846.743.12
Niagara Purple EaglesX9.999.992.1
Nicholls State Colonels7.384.331.77.382.85
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
X5.895.893.57
North Carolina Tar Heels2.3514.946.352.358.92
North Dakota Fighting Hawks
aka North Dakota Fighting Sioux
aka North Dakota
3.68215.713.685.71 und.edu
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
X4.754.754.42
Northeastern Huskies5.89213.575.893.57
Northeastern State RiverHawks4.792.851.684.794.38
Northern Arizona Lumberjacks12.481.518.2512.481.68 nau.edu
Northern Colorado Bears11.441.896.0611.441.84
Northern Illinois Huskies5.17214.065.174.06
Northern Iowa Panthers13.051.518.6313.051.61 uni.edu
Northern Kentucky Norse211.5613.46211
Northern Michigan Wildcats13.21.747.5813.21.59
Northwest Missouri State Bearcats6.621.923.446.623.17
Northwestern State Demons
aka Northwestern State Lady Demons
8.412.942.868.412.5
Northwestern WildcatsX10.5610.561.99
Notre Dame Fighting Irish14.031.987.114.031.5
Oakland Golden Grizzlies212.727.72211
Oglethorpe Stormy Petrels211.3515.59211
Ohio BobcatsX6.716.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 SoonersX9.359.962.11
Oklahoma State Cowboys
aka Oklahoma A&M Aggies
aka Oklahoma State Cowgirls
212.149.81211 trademarks.okstate.edu
Old Dominion Monarchs13.033.483.7513.031.61
Omaha Mavericks
aka Nebraska–Omaha Mavericks
aka UNO Mavericks
5.19214.055.194.05
Oral Roberts Golden Eagles13.332.934.5413.331.58
Oregon Ducks
aka Oregon Webfoots
7.441.315.677.442.82
Oregon State Beavers
aka Oregon Agricultural Aggies
212.887.29211
Ouachita Baptist Tigers12.111.358.9512.111.73
Pacific Tigers3.1417.545.583.146.68
Penn Quakers
aka Pennsylvania Quakers
14.089.161.5414.081.49
Penn State Nittany LionsX18.2818.281.15
Pepperdine Waves14.413.054.7314.411.46
Pittsburg State Gorillas5.271.53.515.273.99
Pittsburgh Panthers
aka Pitt Panthers
14.171.957.2514.171.48
Point Skyhawks10.431.556.710.432.01
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 Friars212.857.37211
Purdue Boilermakers14.281.947.3714.281.47
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 BroncsX8.188.182.57
Robert Morris Colonials
aka RMU Colonials
15.314.643.315.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.046.3412.971.62
Sacred Heart Pioneers8.922.553.58.922.35
Saginaw Valley State Cardinals8.9217.621.988.922.35
Saint Francis Red Flash6.2213.396.23.39
Saint Joseph's Hawks8.425.331.588.422.49
Saint Louis Billikens7.841.415.547.842.68
Saint Mary's Gaels18.825.893.218.821.12
Sam Houston State Bearkats8.912.373.758.912.36
Samford Bulldogs
aka Howard Bulldogs
6.0415.292.536.043.48
San Diego State Aztecs5.56213.775.563.77
San Diego Toreros14.941.728.6914.941.41
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 Broncos8.77212.48.772.4
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.622.364.079.622.18
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 Bulldogs7.312.611.737.32.88
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 Eagles211.5613.48211
Southern Nazarene Crimson StormX11.6613.221.59
Southern Utah Thunderbirds5.58213.775.583.77
Southwest Baptist BearcatsX11.0811.081.9
Southwestern Oklahoma State Bullogs12.123.433.5412.121.73
St. Bonaventure BonniesX8.228.222.55
St. Cloud State Huskies5.61213.755.613.75
St. Francis Brooklyn Terriers11.44.662.4511.41.84
St. John's Red StormX445.25
St. Lawrence SaintsX6.896.893.05
Stanford Cardinal
aka Stanford
aka Stanford Indians
X9.49.42.23
Stephen F. Austin Lumberjacks
aka Stephen F. Austin Ladyjacks
X15.7615.761.33
Stetson Hatters6.5213.236.53.23
Stillman Tigers17.621.839.6517.621.19
Stony Brook Seawolves8.9211.141.258.922.35
Syracuse Orange
aka Syracuse Orangemen
4.5216.833.734.524.65
Tarleton State Texans
aka Tarleton State TexAnns
10.43212.0110.432.01
Temple Owls7.4615.912.137.462.82
Tennessee State Tigers7.675.231.477.672.74
Tennessee Tech Golden Eagles10.371.516.8610.372.02
Tennessee Volunteers
aka Tennessee Lady Volunteers
2.497.012.822.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
10.51.915.510.52
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
Texas-Arlington Mavericks
aka Texas–Arlington Mavericks
aka UT Arlington Mavericks
6.072.632.316.073.46
Toledo Rockets14.31.499.5914.31.47 wxut.pbworks.com
Towson Tigers211.5113.89211
Transylvania Pioneers
aka Kentucky University Pioneers
X8.928.922.35
Troy Trojans9.63212.189.632.18
Truman Bulldogs10.2416.31.5910.242.05
Tulane Green Wave
aka Tulane Olive and Blue
14.113.733.7814.111.49
Tulsa Golden Hurricane7.463.112.47.462.82
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 Santa Barbara Gauchos9.851.974.999.852.13
UCF Knights212.628.02211
UCLA Bruins4.821.563.14.824.35
UConn HuskiesX19.0219.021.1
UIC Flames15.425.422.8515.421.36
UMBC Retrievers211.6212.98211
UMKC Kangaroos8.92.024.398.92.36
UMSL Tritons6.851.913.596.853.07
UMass Lowell River Hawks6.776.041.126.773.1
UMass Minutemen
aka UMass Minutewomen
9.42212.239.422.23
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.61213.176.613.17
UTEP Miners
aka Texas Western Miners
16.053.195.0316.051.31
UTPA Broncs9.722.873.399.722.16
UTRGV Vaqueros3.415.794.643.46.17
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 Aggies15.772.925.3915.771.33
Utah UtesX5.895.893.57
Utah Valley Wolverines9.41.615.839.42.23
VCU Rams211.7711.85211
VMI Keydets5.11.663.075.14.12
Valdosta State Blazers5.89213.575.893.57
Valparaiso Crusaders10.531.516.9610.531.99
Vanderbilt Commodores213.855.46211
Vermont Catamounts7.021.554.517.022.99
Villanova Wildcats12.613.263.8612.611.67
Virginia Cavaliers14.942.955.0614.941.41
Virginia Tech Hokies
aka VPI Fighting Gobblers
aka Virginia Tech Fighting Gobblers
11.472.834.0511.471.83
Wagner SeahawksX7.1411.461.83
Wake Forest Demon Deacons213.825.5211
Washburn IchabodsX10.810.81.94
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 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 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 Catamounts9.812.34.269.812.14
Western Illinois Leathernecks7.381.45.267.382.84
Western Kentucky Hilltoppers
aka WKU Hilltoppers
aka WKU Lady Toppers
X6.876.873.06
Western Michigan Broncos16.411.928.5416.411.28
Western Ontario MustangsX9.429.422.23
Western Oregon WolvesX445.25
Wichita State Shockers
aka Fairmount Shockers
211.5313.76211
Willamette BearcatsX2.875.843.59
William & Mary Tribe
aka William and Mary Tribe
8.531.884.548.532.46
Windsor Lancers13.751.489.3113.751.53
Wisconsin BadgersX6.966.963.02
Wisconsin–Whitewater WarhawksX13.6513.651.54
Wofford Terriers4.79214.384.794.38
Wright State Raiders6.192.132.916.193.39
Wyoming Cowboys
aka Wyoming Cowgirls
12.241.597.6812.241.72
Xavier Musketeers
aka Saint Xavier Saints
aka St. Xavier Saints
X15.4615.461.36
Yale BulldogsX8.518.512.47
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 = "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( 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) .. ';'
	-- 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_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 '', args['border'])
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