Using Colors in R
The statistical programming language R allows you to specify colors for your output in multiple ways, all of which follow the “col” command, which is short for “color” or “colour.” For example, all five of these methods refer to the same shade of red:
Color name:
col = "red3"
Hex code:
col = "#CD0000"
RGB (0-255):
col = rgb(205, 0, 0, max = 255)
RGB (0.00-1.00):
col = rgb(.80, .00, .00)
Index number:
col = colors() [555]
You can browse the color data in the embedded Google Sheet, open the Google Sheet in a new window, download a Microsoft Excel version of the file, or download a PDF version.
With the exception of white, which is at the top of the list, the 657 color names are listed in alphabetical order, which corresponds to their index numbers. A few colors are listed more than once to accommodate differences in spelling (“gray” for the US and “grey” for the UK, for example) or numbering schemes (e.g., “aquamarine” and “aquamarine1”) but have their own index numbers.
Updated: 2020-01-24
You can freely use, share, and adapt this data – even commercially – as long as you properly attribute it to Barton Poulson and datalab.cc, thanks to a Creative Commons Attribution 4.0 International License (CC-BY 4.0).
If you have any trouble with these tables or downloads, please contact us at hello@datalab.cc.