mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-31 04:58:21 +00:00
1.8 KiB
1.8 KiB
Generate a color scheme based from a single color
Generating human-friendly color schemes has always been a disaster (for me) to figure out especially with no cursory knowledge whatsoever on color theory. So I've been thinking how to do such thing with the result that doesn't make gouge my eyes out.
Thus, for the solution, we'll include some opinionated things.
- Generate a color with the HSLuv color space since it is .
- The color palette is composed of 16 colors inspired on Nord's documented color scheme. This easily provides a Base16 color scheme generator.
- If the given color is bright, it should create a light theme.
Here's the procedure for the color sections.
- For
base00
, invert the lightness of the color by $\pm20$ (e.g., $20$ if it's dark, $80$ if it's bright). - For
base01
tobase07
, add the lightness by $\pm5$ to $\pm10$. You can make additional tweaks for all of the parameters (e.g., hue, saturation, lightness) of the color. - On
base08
tobase0F
, you can make a uniquely randomized color palette as long as it contains at least 3 colors.
What if we want to make changes to the generation process? One way to do it is to separate the hardcoded process into a configuration. From there, we can set various procedures such as the usual Base16 scheme, terminal.sexy, or your own.