L55
a0
b0

Precept

Palette design as trajectory optimization.

A color is a point in a color space, which is determined by parameters like the red, green, and blue values, the hue, saturation, and lightness, or chroma, lightness, etc., where the gamut is the set of representable colors (your monitor is probably a gamut called sRGB). Many people also have a color vision deficiency, which affects the distinctness of colors in this space. A colormap is either a continuous path through that space or a set of points for categorical data, subject to some constraints that you'd like to enforce, like uniform perception, maximal distinctness, and so on. This tool solves that palette generation problem with optimization, and provides a number of metrics to help design pleasing and scientifically validated palettes.

Getting around

Double-click empty space to add a node: in a cut panel it lands on that cut, in the 3D view it takes the color you clicked on. Drag to move, right-click (or press and hold on a touchscreen) for a menu to pin a node or delete it; a pinned node is held still by the solver. The tools switch between nodes, keep-out spheres and halfplanes. Run Adam to optimize against the enabled terms. Export as matplotlib, CSS, CSV, ParaView or JSON, or copy a link that carries the whole palette. Every control and every metric has a ? beside it: hover one for what it does.

Motivation (personal)

Color palettes have been on my mind for quite some time as someone who creates plots, charts, data visualization, etc. for my work (normally, a figure in some paper). I recall very early on having a discussion with a mentor (I believe it was Mark Moll) who mentioned that I should be concerned with red-green colorblindness (protanopia and deuteranopia, more precisely) after seeing a plot I had made which had bright red and green as part of a categorical palette.

At that point in my life I was relatively unaware of the many concerns of graphic design, and after some research on color palettes (e.g., the great talk on viridis for matplotlib) I was quickly sent down a rabbit hole as I learned about color perception and how to scientifically design palettes. I was always a bit frustrated by the lack of flexibility and visualization available in tools like cubehelix palettes or other offerings like Seaborn. This led to a custom viridis-like palette I used for many of my papers, and eventually this weekend project you see now.

Motivation (professional)

Perceptual color space is not Riemannian, i.e., a large color difference is perceived as less than the sum of steps that make it up. This tool was an exercise in trajectory optimization in a non-Riemannian space, to hopefully provide better palettes than many other colormap generating tools do.

Credit

Built by Zachary Kingston, using Claude Opus 5. zkingston.com / zkingston@purdue.edu