A Field Guide to Color: Beyond RGB
Reinventing the Wheel
What the plotting library seaborn
does by default for 12 colors, as you saw previously, is simply take evenly-spaced colors with a specified hue and the maximum chroma available at a given lightness. This can easily be modified to produce however many colors you want, and by setting the lightness we can make sure it works on dark or light backgrounds. However, it has a disadvantage: we're wasting space. Varying lightness and chroma lets us produce colors that are farther away from each other. Once you get to 12 colors using a color wheel, it starts to become difficult to tell consecutive colors apart at small sizes.
I've plotted the twelve colors seaborn uses here. The uneven spacing is fixable (the color space seaborn uses isn't as precise as CAM16-UCS about color difference and specifically the idiosyncrasies of blue and green), but the fact that we're not using the available space on the other axes isn't.
We're going to try other approaches, but I don't want to be too harsh. This is a pretty solid system for generating palettes with arbitrary numbers of colors, which is a very hard problem for which even passable solutions are appreciated. But there are better ways to pick a bespoke set of colors.
Reinventing the Wheel
What the plotting library seaborn
does by default for 12 colors, as you saw previously, is simply take evenly-spaced colors with a specified hue and the maximum chroma available at a given lightness. This can easily be modified to produce however many colors you want, and by setting the lightness we can make sure it works on dark or light backgrounds. However, it has a disadvantage: we're wasting space. Varying lightness and chroma lets us produce colors that are farther away from each other. Once you get to 12 colors using a color wheel, it starts to become difficult to tell consecutive colors apart at small sizes.
I've plotted the twelve colors seaborn uses here. The uneven spacing is fixable (the color space seaborn uses isn't as precise as CAM16-UCS about color difference and specifically the idiosyncrasies of blue and green), but the fact that we're not using the available space on the other axes isn't.
We're going to try other approaches, but I don't want to be too harsh. This is a pretty solid system for generating palettes with arbitrary numbers of colors, which is a very hard problem for which even passable solutions are appreciated. But there are better ways to pick a bespoke set of colors.