mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
25b448f2367b7fee4b49f01091b0f8938d7ed88b
Tune how automatic colors are derived. It used to use a custom brightness calculation formula to determine in background color is light or dark, then then simply interpolate the background color to either white or black to drive the fill and tab colors. There were a couple issues: - Really dark background color would end up interpolating more than a moderately dark color, leading to the fill color being desaturated and also perceptually far from background color leading to a high-constrast look. Ideally we want to have a fixed offset in terms of perceptual difference between fill and background color. - The brightness calculation was wrong and flipped the green and blue coefficients. Also, calculating perceptual brightness in sRGB gamma space is inherently wrong as the components are not linear. - Blending colors in sRGB space are also not ideal because we are blending in gamma space (not linear), and also perceptually each component will contribute differently. To fix this, use CIE LAB colors and just change the L* component of the colors in fixed offsets to calculate a new color that's a brighter/darker version fo the previous one. This is not completely accurate but gives a more stable result over a large range of input colors. The new fill / tab colors are a little more saturated as a result which subjectively may or may not be more pleasant but with automatic colors it won't be perfect, and the user who cares would likely use Vim colorscheme mode instead.
…
Vim - the text editor - for macOS
-
MacVim homepage: https://macvim-dev.github.io/macvim
-
Download the latest version from Releases
-
How to build MacVim from source
-
Vim README: README_vim.md
Languages
Vim Script
52%
C
38.1%
Objective-C
3.1%
Roff
1.6%
Makefile
1.2%
Other
3.2%