mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-31 04:58:21 +00:00
33 lines
1.8 KiB
Org Mode
33 lines
1.8 KiB
Org Mode
:PROPERTIES:
|
|
:ID: f5bd284c-04aa-453b-a7d7-32655776308d
|
|
:END:
|
|
#+title: Generate a color scheme based from a single color
|
|
#+date: "2020-11-05 17:21:58 +08:00"
|
|
#+date_modified: "2021-05-04 20:52:06 +08:00"
|
|
#+language: en
|
|
|
|
|
|
[[id:9d247d19-368e-44ea-893e-af3403c2682f][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 [[https://www.nordtheme.com/docs/colors-and-palettes][Nord's documented color scheme]].
|
|
This easily provides a [[https://github.com/chriskempson/base16][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~ to ~base07~, 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~ to ~base0F~, you can make a uniquely randomized color palette as long as it is recognizable (ideally with 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 [[https://github.com/alexmirrington/base16-spectrum-generator][usual Base16 scheme]], [[https://terminal.sexy/][terminal.sexy]], or your own.
|
|
|
|
# TODO: Observe the hand-crafted custom color scheme
|
|
# TODO: Test if it's accurate or not
|