Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better color interpolation when base16-shell is in use
If your termshark theme expresses its colors in RGB format (e.g. #aa55bc), and termshark is running in a 256-color terminal (without COLORTERM=truecolor set), then termshark will try to find the closest matching color in the 256-color space. If you are using base16-shell (https://github.com/chriskempson/base16-shell), then your base16-shell theme likely has remapped colors 0-21 out of the terminal's 256-color space. Termshark doesn't know this, and assumes colors 0-21 are "normal". This can result in it interpolating a poor match for the theme's desired RGB color. If you set main.ignore-base16-colors = true in termshark.toml, then termshark will ignore colors 0-21 when selecting the best match for RGB colors used in a theme. For example, this would mean black - RGB #000000 - would map to color 232 in the 256-color space (https://jonasjacek.github.io/colors/). If the toml variable is not set, then termshark will try to guess whether or not to ignore colors 0-21 by checking for the env var BASE16_SHELL - if present, it will ignore those colors, assuming they have been remapped. Note that this does not affect termshark's base16 theme itself, because its colors are expressed using a syntax that translates directly to the 256-color space. Complicated... :-/
- Loading branch information