File Exchange

image thumbnail


version (2.56 KB) by Alan Bindemann
Return NFL color values by team or city name

1 Download

Updated 12 Sep 2007

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

In honor of the start of the 2007/2008 season, a function that provides RGB color values for all 32 NFL teams...

Cite As

Alan Bindemann (2021). nflcolor (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Max Zelin

Well, I know nothing about this site and my sister was the mathematical genious in MY family, but having been asked to design a piece of jewelry using one of the team's colors, I came across this page. The red is kind of "questionable", and if I was one to download files indiscriminantly to my computer, I'm sure I am one of the few people to whom this WOULD be of value. Matlab, maybe not so much, but ME, yes. Didn't take advantage of it though, not sure what kind of file it is, but I WOULD love to know the RGB color value of the red in the Bucs colors. . .would help me know what type of red to use when I design the piece. . . .this girly-girl doesn't plan to EVER attend a football game of any kind. . . . .

John D'Errico

I'll admit, I'm still wondering why Matlab needs an NFL color mapping utility. 8-)

Given that, I like how the author has cleaned it up. In context, its a good code if this is something that you have a need for as a user.

I was debating whether this code was worth a rating of 4 or 5. Initially, I wanted to make it a 4, since it does not seem to be of real value to many people. On the other hand, this is by far the best code I've seen so far on the file exchange to supply the colors of all NFL teams. In that context, I'll give it a 5 rating. ;-)

John D'Errico


Defaulting to the Jets over the Giants is a serious flaw.

Slightly more seriously, from a coding point of view the code could have been more simply written, yet be more flexible using either strmatch or strncmp. This would allow the user to shorten the names. For example, you could then call it as nflcolor('cinc') and not get an error as long as the shortening was unambiguous.

This would also simplify the code, allowing it to be written as just an index into an array of colors, rather than as a massive switch/case statement.

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!