Replies: 3 comments 5 replies
-
Color specifications in terminalsFirst I need to explain how the colors are specified in terminals. The colors are specified by the terminal applications (CUI commands and applications such as line editors like ble.sh and CUI text editors like Vim), and the terminals receive the color specifications and use them to render texts in the display. There are mainly two ways of the color specification. One is the index color, and the other is the direct specification. For the index colors, the terminals have their own palette, where an index is assigned to each color. The palette depends on the terminal and its theme, but there is a convention in the correspondence between the colors and the indices. That is, index 0 is black(ish) color, index 1 is red(ish), index 2 is green(ish), index 3 is yellow(ish), index 4 is blue(ish), index 5 is magent(ish), index 6 is cyan(ish), and index 7 is whit(ish) color. Index 8..15 are brighter versions of index 0..7. In total, there are 16 index colors that usually depend on the terminal's theme. Note that it is just a convention, so a terminal can have completely different palette not following the convention. For example, the Solarized theme for terminals do not follow this convention. In the market, there is additional colors, index 16..255, for which there is a de facto standard by XTerm, and we can assume the palette is common for all the modern terminals. For the index colors, the terminal applications specify just an index without knowing how the index is exactly mapped to the actual color. Nevertheless, the terminal applications can assume the convention for the first 16 colors (index 0..15). Some of modern terminals also support the direct specification of the color using the 24-bit RGB values. Color specification in ble.shThe color names such as
Answers to the question
As explained above.
No. Those theme-dependent 16 colors are formed as a consensus among historical terminals and terminal applications, so one cannot arbitrarily add new theme-dependent colors. It's technically possible to define a new index for a specific color, but that breaks the assumptions of other terminal applications and might cause unexpected behavior (though it's just strange coloring at worst).
The content of the palette is terminal-dependent and theme-dependent. However, the mechanism of the index colors are common in all the terminals. Rather, the direct color specifications are not supported by all the terminals.
As in an answer to Q3, there are no other theme-dependent colors, but we may still give names to the other "fixed" colors. That is, maybe we can introduce custom color mapping from names to hex specifications, but ble.sh currently doesn't offer a customization interface to allow that. |
Beta Was this translation helpful? Give feedback.
-
Hello, did you succeed in doing this? Looking for something like this but using the tokyonight colors. |
Beta Was this translation helpful? Give feedback.
-
In a commit e4cce0e, I just added an option |
Beta Was this translation helpful? Give feedback.
-
Setup: Using WezTerm, with the catppuccing theme enabled.
I've read the docs, seems like I need to create
~/.blerc
file containing a modified version of default colors, using the wikia I found that colors could be defined in a number of ways: integer, a hexadecimal value, and a color name.I want to know how the color name -
red
,black
,purple
.. etc work.I initially thought just replacing default colors with their look-a-like counterparts in the catppuccin palette would work. Upon further tinkering I found that "faces" specified with color
red
have automatically adapted to the catppuccin version ofred
(#f38ba8).Questions I had in my head-
rosewater
(#f5e0dc) also do exist? (if so then developing a theme would be extremely simple.)Beta Was this translation helpful? Give feedback.
All reactions