The Swatch Color Function
Crayola and Mondrian
Crayola and Mondrian
Historically, a paint swatch shows a sample of dried paint. My new function Swatch in the Wolfram Function Repository has citations for 6,233 color names represented by 2,688 distinct colors. Try it with some color names you know.
In[]:=
ResourceFunction["Swatch"]["lilac"]
Out[]=
SwatchGrid function
SwatchGrid function
Some color swatches
Some color swatches
Here are names of colors whose source lists include Crayola:
In[]:=
crayolaNames=Normal@ResourceFunction["Swatch"]["Dataset"][Select[MemberQ[#Sources,"Crayola"]&],"Name"];SwatchGrid[crayolaNames,6]
Out[]=
Here’s a 1918 Mondrian painting. What are the names of those colors?
In[]:=
ResourceFunction["Swatch"][#,5]&/@{"#C59F41","#4B6687","#B48674"}
Out[]=
{{pitchpin,orient yellow,brass,olive-ocher,yellow smoke},{china blue,stone blue,nikko,madonna,azurite blue},{vieux-rose violacé,rosebloom,crocus,maple,raddle}}
Maybe, some of those color names are what he used. Here’s a handful of stranger colors:
Out[]=
Short color names have a pleasing dictionary quality: blue, ecru, puce, teal. For colors with three or more citations, we can ask for all the names that are exactly four letters long:
In[]:=
fourByFour=Normal@ResourceFunction["Swatch"]["Dataset",3][Select[StringLength[#Name]==4&],"Name"];SwatchGrid[fourByFour,7]
Out[]=
These all return the same color:
In[]:=
ResourceFunction["Swatch"]/@{"forest green","forestgreen","Forest green"}
Out[]=
{,,}
Nearby colors
Nearby colors
Sometimes a hex color has no name ... or one of = 16,777,216 or so program-generated proprietary names. But I mostly wanted names from the dictionary. A hex value, an RGBColor or a decimal RGB triple can be used to search for nearby named colors.
24
2
In[]:=
SwatchGrid[Keys[ResourceFunction["Swatch"]["#604499",25]],5]
Out[]=
The same operation can start with a decimal RGB value:
In[]:=
SwatchGrid[Keys[ResourceFunction["Swatch"][{.2,.5,.7},25]],5]
Out[]=
Or it can start with another name. This usually keeps the named color itself at the head of its neighborhood:
In[]:=
SwatchGrid[Keys[ResourceFunction["Swatch"]["spruce",25]],5]
Out[]=
XKCD Color Survey
XKCD Color Survey
The XKCD Color Survey collected opinions from hundreds of thousands of people on color, and came up with some useful data. Here are some colors sourced to that survey.
In[]:=
xkcd=RandomSample[SeedRandom[123];Normal@ResourceFunction["Swatch"]["Dataset"][Select[#Sources==={"XKCD"}&],"Name"],49];SwatchGrid[xkcd,7]
Out[]=
RGB light, CMYK ink and the days before television
RGB light, CMYK ink and the days before television
RGB and CMYK describe two different mixing stories. A display begins in darkness and adds red, green and blue light. Printing usually begins with white paper and uses cyan, magenta and yellow inks to remove parts of that light; black ink is added because three real inks do not make a clean, economical black.
Out[]=
| ||||||
|
Since LeBron is in the news, it’s odd to me that Le Blon started color printing. Paint manufacturers gradually arrived at the methods for mixing various colors. A paint catalog would list the amounts of each (proprietary) paint needed to produce each color.
1710 — Le Blon printing: yellow, red, blue and sometimes black inks.
1855 — Winsor & Newton: gamboge, raw sienna, Venetian red, crimson lake, Prussian blue and Vandyke brown.
1893 — William Kurtz: patented a three-plate color-separation process using cyan, magenta and yellow inks.
1906 — Thomas A. Lenci of the Eagle Printing Ink Company is widely credited with introducing cyan, magenta, yellow and black process inks.
1912 — Schmincke Horadam: chromium yellow, vermilion, ultramarine, viridian, yellow ochre, raw umber, Venetian red and Payne’s grey.
1926 — Dutch Boy: mixed colors from its proprietary palette of Dutch Boy white lead, chrome yellow, Italian burnt sienna, chrome green, Prussian blue, Bulletin red and lamp black. White lead provided the base while yellow, red, blue and black formed a CMYK-like mixing core.
1936 — Murray–Davies: provided a way to estimate effective printed dot area from measured reflectance, enabling tone reproduction and dot gain.
1937 — Hans Neugebauer: published a mathematical model connecting CMYK ink coverage with resulting tristimulus color, providing the foundation for calculated RGB–CMYK conversion in printing.
1855 — Winsor & Newton: gamboge, raw sienna, Venetian red, crimson lake, Prussian blue and Vandyke brown.
1893 — William Kurtz: patented a three-plate color-separation process using cyan, magenta and yellow inks.
1906 — Thomas A. Lenci of the Eagle Printing Ink Company is widely credited with introducing cyan, magenta, yellow and black process inks.
1912 — Schmincke Horadam: chromium yellow, vermilion, ultramarine, viridian, yellow ochre, raw umber, Venetian red and Payne’s grey.
1926 — Dutch Boy: mixed colors from its proprietary palette of Dutch Boy white lead, chrome yellow, Italian burnt sienna, chrome green, Prussian blue, Bulletin red and lamp black. White lead provided the base while yellow, red, blue and black formed a CMYK-like mixing core.
1936 — Murray–Davies: provided a way to estimate effective printed dot area from measured reflectance, enabling tone reproduction and dot gain.
1937 — Hans Neugebauer: published a mathematical model connecting CMYK ink coverage with resulting tristimulus color, providing the foundation for calculated RGB–CMYK conversion in printing.
The 3D Color space
The 3D Color space
If we divide up the color space into a 4×4×4 cube, what’s the best known color in each cube?
If we divide up the color space into a 4×4×4 cube, what’s the best known color in each cube?
Out[]=
Hmmm... “best-known” might be a stretch for prasinus. The runners up:
And what is third place?
Colors have provenance
Colors have provenance
Sources for colors can agree that a name exists without agreeing on one exact RGB value. Swatch therefore distinguishes the source used for the displayed value from the complete list of sources that attest the name.
The first result says where this particular value came from. The second says where the name was found. A long source list is evidence that a name is well established; it is not a claim that every source printed exactly the same swatch.
A 2D color map
A 2D color map
Here’s a Voronoi diagram of all the distinct colors:
Yes, things seem more muted away from the edges.
Jurassic Swatch
Jurassic Swatch
I mentioned in my Geology talk that all colors of geological eras gets their own official color. Since I wanted to have all specific, non-proprietary colors that had specific names, I added them.
And an image using only that palette.
Possible Problems and directions for version 2
Possible Problems and directions for version 2
The collection combines web colors, XKCD survey colors, historical standards, dictionaries, artists’ materials and selected scientific colors. A major problem came from ISCC-NBS. Its system usefully classifies colors into 267 perceptual categories, but its reference tables assigned hundreds of historical names to those category centroids. In other words, up to 200 color names could attach to the exact same hex-code, creating enormous artificial collisions. Swatch retains ISCC-NBS as a naming source but uses more specific sources for exact values whenever possible. In addition, there were dozens of color names as controversial as the Crayola’s Flesh crayon, which was renamed Peach in 1962. Many of the historical sources date to before 1930. It’s possible that some terms that should be removed were missed. A few historical pigments based on lead, mercury, radium, uranium, cadmium, arsenic and hexavalent chromium aren’t used much these days. However, chromium(III) salts are used in leather-working, whereas chromium(VI) is heavily restricted.
Swatch is large, but it is not yet complete. It may never be fully accurate. A comparison with the Collins-derived Association of British Scrabble Players color vocabulary exposed more than fifty plausible color terms as either absent or valid alternate names. Since submission for publication, these colors surfaced as possibly needing study:
And variant names:
I hope you find a color in it that you did not know you needed. You can find Swatch in the Wolfram Function Repository. I hope this passes the acid test.