5 ms·
Several years back, frustrated by this same problem and underlying constraints, I spent a weekend writing a machine-aided cost minification algorithm (aka what
by ComputerGuru 4y ago
Several years back, frustrated by this same problem and underlying constraints, I spent a weekend writing a machine-aided cost minification algorithm (aka what most startups call "advanced ML") that used LAB and LUV to try and pick 2x8 colors (the eight colors in dark/bright configurations) where the cost was defined as
a) how far apart each of the color pairs was from one another (hue only),
b) how far apart each dark/bright color in a pair were from one another,
c) how high the contrast against a specific background color (provided as a parameter),
d) how far the perceived brightness of any "bright" color differed from the rest of the "bright" colors,
e) how far the perceived brightness of any "dark" color differed from the rest of the "dark" colors,
f) how far each of the 8 base colors strayed from a range that could passably be called the de facto colors mapped to each of the palette members (e.g. cyan, blue, black, white, etc) so that TUI apps using colors not to distinguish but to draw (expecting "blue" to be a shade of blue) would not be thrown off.
Unfortunately I never found the results to be pleasing to the eye. I also think there was something wrong in either the math of the individual cost function factors themselves or the weights assigned to each factor because I didn't feel like the results were properly spaced out or representative of what even a local minima what look like if the math was all correct. I didn't really want to put more time into it than I already had, but I'm convinced that it's possible to generate a fixed set of 2x8 colors that meet these conditions for any given background color (at least one for a black or dark grey background and another palette for a white or off-white background).
- vintermann 4y agoPixel artists have really, really explored that problem space. You might want to check out the palettes on lospec, and the discussions about these things on pixeljoint. I'm not deep into colour theory myself, but I get awed by the diagrams Dawnbringer's palette analyser tool produces, let alone the things pixel artists do to highlight the opportunities and limitations in palette choice.