zsh-workers
 help / color / mirror / code / Atom feed
df77713979d3776528a83dd3fd917506f3d5e6a9 blob 1827 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
COMMENT(!MOD!zsh/nearcolor
Map colours to the nearest colour in the available palette.
!MOD!)
The tt(zsh/nearcolor) module replaces colours specified as hex triplets
with the nearest colour in the 88 or 256 colour palettes that are widely
used by terminal emulators.  By default, 24-bit true colour escape codes
are generated when colours are specified using hex triplets.  These are
not supported by all terminals.  The purpose of this module is to make
it easier to define colour preferences in a form that can work across a
range of terminal emulators.

Aside from the default colour, the ANSI standard for terminal escape
codes provides for eight colours. The bright attribute brings this to
sixteen. These basic colours are commonly used in terminal applications
due to being widely supported. Expanded 88 and 256 colour palettes are
also common and, while the first sixteen colours vary somewhat between
terminals and configurations, these add a generally consistent and
predictable set of colours.

In order to use the tt(zsh/nearcolor) module, it only needs to be
loaded. Thereafter, whenever a colour is specified using a hex triplet,
it will be compared against each of the available colours and the
closest will be selected. The first sixteen colours are never matched in
this process due to being unpredictable.

It isn't possible to reliably detect support for true colour in the
terminal emulator. It is therefore recommended to be selective in
loading the tt(zsh/nearcolor) module. For example, the following
checks the tt(COLORTERM) environment variable:

example([[ $COLORTERM = *LPAR()24bit|truecolor+RPAR()* ]] || \
    zmodload zsh/nearcolor)

Note that some terminals accept the true color escape codes but map
them internally to a more limited palette in a similar manner to the
tt(zsh/nearcolor) module.
debug log:

solving 9694bc105 ...
found 9694bc105 in https://inbox.vuxu.org/zsh-workers/35498-1541372241.799276@xFmj.Ya0_.4Zms/

applying [1/1] https://inbox.vuxu.org/zsh-workers/35498-1541372241.799276@xFmj.Ya0_.4Zms/
diff --git a/Doc/Zsh/mod_nearcolor.yo b/Doc/Zsh/mod_nearcolor.yo
new file mode 100644
index 000000000..9694bc105

Checking patch Doc/Zsh/mod_nearcolor.yo...
Applied patch Doc/Zsh/mod_nearcolor.yo cleanly.

index at:
100644 df77713979d3776528a83dd3fd917506f3d5e6a9	Doc/Zsh/mod_nearcolor.yo

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).