The usual "R code color list" is the set of named colors that the base graphics functions accept in R, such as red, blue, steelblue, or tomato. You call them by writing the name in quotes when you set a color argument, like col, or when you use a palette function. The detail most people get wrong is that many of these names belong to a fixed system that was imported into R rather than invented for it, so a name you know from CSS is not always the name R expects.
R carries a large table of named colors that its plotting functions can read directly. The names are English words and word combinations, written in lower case, without spaces. When you type a name R does not recognize, the plot may fail or the color may silently fall back to something you did not intend, so getting the spelling right matters more than getting the hex value right.
Why Some Names Look Familiar and Some Do Not
The named colors in R come from the same broad system that web pages use, so a good share of the names will look familiar if you have written any CSS. That is also where the confusion starts. The web system has grown over time, and R's table is its own snapshot. A name that exists in a newer style sheet may not exist in R, and a name R accepts may not match the web name exactly.
The practical rule is simple: treat the name as something you verify, not something you assume. If you are copying a color name from a design tool, a style sheet, or another program, check it in R before you build a whole figure around it. Testing a name costs almost nothing.
There is also a group of names that look like plain colors but behave like a family. Grey and gray are both accepted, and so are spellings with and without a suffix. That is convenient, but it means two names can produce nearly the same color, and a reader looking at your code may not realize they are interchangeable.
Finding the List Without Guessing
You do not need to memorize the list. R can print it for you, and R can show you what each entry looks like.
- The function colors() returns the full set of names R knows. Run it on its own to see the list in the console.
- Passing a name to the col argument of a plotting function sets that color. This works the same way for points, lines, bars, and text.
- The palette function can draw a strip of swatches so you can see the colors side by side rather than reading names.
When the console output is too long to read comfortably, write it to a file or ask R for a subset. You can pull out names that contain a word you care about, such as all the entries with blue in them, and then choose from the short list. That approach beats scrolling through hundreds of lines.
One habit worth building: keep your chosen names in a small block at the top of your script. When you change a color later, you change it once instead of hunting through every plotting call. It also makes your figures easier for someone else to read.
Names, Hex Values and Where Each One Fits
Every named color stands for a hex value, which is a code made of letters and digits that describes the color exactly. R accepts either form in a color argument. The choice between them depends on what you are doing.
- Names are easier to read and remember, so they suit quick plots and teaching examples.
- Hex values are exact and portable, so they suit figures you will reuse or share with someone using different software.
- Names are limited to what R knows, while hex values let you match a color from anywhere.
A common mistake is to assume a name means one exact color. Some names are close cousins and some are surprisingly different from what the word suggests. A name like salmon or chocolate will not look like the food you picture. Hex values remove that guesswork because the code is the color.
If you need a color to match a printed chart, a brand palette, or another figure, get the hex value from the place that defines it and test it in R. If you only need a readable figure, a named color is usually faster and less error-prone. Neither approach is better in general; the right one follows from what the figure has to do.
Where Color Belongs in a Model Aircraft Project
If you found this page while planning paint for a model, the R color list is a useful planning tool rather than a paint recipe. You can use R to compare candidate colors, order them, and see how they sit together before you commit. That is a design exercise, not a mixing instruction.
Two things transfer poorly from screen to model. Screens glow, and paint does not. A color that reads clearly on a monitor can look flatter or darker on a painted surface, and surface finish changes the result again. Screen colors also do not tell you how a paint covers, how it builds up in thin coats, or how it behaves over a primer. For those answers, read the paint label and the maker's chart.
Use the list for decisions like which markings should stand apart from the airframe, or how a set of colors looks side by side in a diagram. Then take those ideas to real paint and test them. Paints and thinners interact in ways a screen cannot show, so try any combination on a spare part or a piece of sprue first and follow the maker's guidance. Please see the safety notes below for handling and ventilation.
A Short Example You Can Copy
Suppose you want three colors for a chart or a planning sketch. Start by listing candidate names in the console, and pick a few that read clearly against white. Set your first plotting call to one name, add a second set of points or bars in another, and use the third for labels or a reference line.
Now replace one name with a hex value you have checked, and redraw. Notice how the change affects contrast. If two of your colors sit too close together, adjust one of them rather than adding a fourth. Fewer, well-separated colors are easier to read than many similar ones.
The same habit works for a model project sketch: choose a small set of colors, see whether each one separates from its neighbors, and only then look for paints that come close. Keep the names or codes you settled on in your notes, next to the paint you eventually choose, so you can find your way back if you need to match a touch-up later.
When the Color Looks Wrong in the Plot
If a color does not appear as you expected, check the name first. A misspelled name is the most common cause. Next, check that the argument is in the right place; some plotting functions take color in a different argument than you might assume, and a color placed in the wrong slot can be ignored.
If the name is right and the color still looks off, the cause is often the number of colors you asked for. Palette functions stretch or repeat a set of colors to fit your data, so a name can be diluted when many categories are present. Ask for fewer categories or set the colors yourself.
Finally, remember that the display and the output file can differ. A figure that looks correct on screen may print differently when exported. Check the exported file, not just the window, before you rely on it. Labels, fonts, and color handling can vary by version, so check the help pages for your own setup when in doubt.
Rules for model flying and for using hobby materials differ by country, so check your national aviation regulator and the product label. See the safety notes below.