mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-31 07:57:57 +00:00
331db7e5da
While making the note more complete in terms of metadata, it's redundant because it's supposed to be a personal wiki. Only one person is the assumed owner of them.
30 lines
1.7 KiB
Org Mode
30 lines
1.7 KiB
Org Mode
#+title: Generate a color scheme based from a single color
|
|
#+date: "2020-11-05 17:21:58 +08:00"
|
|
#+date_modified: "2020-11-19 19:32:26 +08:00"
|
|
#+language: en
|
|
|
|
|
|
[[file:2020-09-19-18-43-07.org][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
|