X资源和颜色

Xresources and colors

寻找 xterminal 主题时,只需 google 搜索即可找到很多。

这是一个:

*背景:rgb:00/00/00

*前景:rgb:a8/a8/a8

*color0: rgb:00/00/00

*color1: rgb:a8/00/00

*color2: rgb:00/a8/00

*color3: rgb:a8/54/00

*color4: rgb:00/00/a8

*color5: rgb:a8/00/a8

*color6: rgb:00/a8/a8

*color7: rgb:a8/a8/a8

*color8: rgb:54/50/54 *color9: rgb:f8/54/50 *颜色 10:rgb:50/fc/50 *color11: rgb:f8/fc/50 *color12: rgb:50/54/f8 *颜色 13:RGB:f8/54/f8 *color14: rgb:50/fc/f8 *color15: rgb:f8/fc/f8

所以背景和前景色看起来是合法的,但是,从 0 到 15 的颜色是什么?我可以假设像 ls 这样的程序会使用它们,因为更改这 16 种颜色会影响 'ls --color' 输出。

如果有人能阐明我对这些颜色的用途以及它们如何影响配色方案的看法,我将不胜感激。

名称 color0color15 是 xterm 资源名称,对应于使用转义序列设置的 ANSI (0-7) 和 aixterm-like (8-15) 颜色。资源名称在 xterm manual page, and the escape sequences in the XTerm Control Sequences. Various applications use these escape sequences, either via a library such as ncurses 中列出或硬编码。 (GNU ls 介于两者之间——它不使用常规终端数据库,但有自己的 不同 一个,这很麻烦)。

它们是资源,以便用户可以轻松自定义调色板。例如,exact shade of blue的使用一直存在争议。

有 "could" 颜色 16-255 的资源名称,除了 X 库中有 400 个资源名称的限制(所以 xterm 不提供这些名称——它已经超过了限制在 2004).