Is it feasible to make use of called colors in Zsh past ANSI names?

I recognize there are means to make use of ANSI shade names in Zsh (such as red), yet Zsh sustains 256 colors by number. I'm interested if there's any kind of means to describe the non-ANSI colors by a name? (Without simply sticking them in a variable)

2019-05-04 16:41:33
Source Share
Answers: 1

The first 16 colors have actually been typical for a long period of time (and also have primarily typical tones ). 256 colors are an extra current expansion specified by xterm and also suitable terminals. The xterm documents has this to claim concerning colors 16-- 255 :

These define the colors for the 256-color expansion. The default source values are for colors 16 via 231 to make a 6x6x6 shade dice, and also colors 232 via 255 to make a grayscale ramp.

The colors can be transformed from within the terminal; see the ctlseqs documents. As an example print '\e]4;42;taupe\a' adjustments shade 42 to be taupe (the shade names are readily available in /etc/X11/rgb.txt or a few other distribution-dependent area ).

If you're material to think that the colors over 16 have their default values, you can expand the $color array with names from rgb.txt. You'll require to do a little math to locate the closest estimate of 8-bit colors in lg (6 ) -little bit colors.

2019-05-08 00:37:54