如何使Alacritty显示真颜色
由于某种原因,我的Alacritty安装没有使用配置文件中指定的颜色。
这是我的配置的相关部分。
env:
TERM: alacritty
colors:
primary:
background: '#1c1f26'
foreground: '#d8dee9'
dim_foreground: '#a5abb6'
cursor:
text: '#2e3440'
cursor: '#d8dee9'
vi_mode_cursor:
text: '#2e3440'
cursor: '#d8dee9'
selection:
text: CellForeground
background: '#4c566a'
search:
matches:
foreground: CellBackground
background: '#88c0d0'
bar:
background: '#434c5e'
foreground: '#d8dee9'
normal:
black: '#3b4252'
red: '#bf616a'
green: '#a3be8c'
yellow: '#ebcb8b'
blue: '#81a1c1'
magenta: '#b48ead'
cyan: '#88c0d0'
white: '#e5e9f0'
bright:
black: '#4c566a'
red: '#bf616a'
green: '#a3be8c'
yellow: '#ebcb8b'
blue: '#81a1c1'
magenta: '#b48ead'
cyan: '#8fbcbb'
white: '#eceff4'
dim:
black: '#373e4d'
red: '#94545d'
green: '#809575'
yellow: '#b29e75'
blue: '#68809a'
magenta: '#8c738c'
cyan: '#6d96a5'
white: '#aeb3bb'
颜色部分几乎完全来自Nord配色方案,除了我使我变暗的背景颜色。
但是,当我测试用于16个基本颜色(使用逃生)序列的颜色时:
printf "\033[0;32m_hello_\033[0m\n" #to display "_hello_" in the color green
我得到的颜色在我的任何配置中都不存在,
我试图确定使用<< a href =“ https://aur.archlinux.org/packages/colorpicker” rel =“ nofollow noreferrer”> colorpicker aur aur so:so:
colorpicker --short --one-shot --preview
显示的颜色与显示的颜色完全不同在配置中指定的。例如:
- 对于绿色而不是
#a3be8c
,我获得#b5bd68
- 对于红色而不是
#bf616a
,我得到#cc66666 < /code>
据我所知,预期和实际颜色之间没有明确的关系。我不确定,也许有一些颜色近似。
我在这里做错了什么?如果这是一个近似问题,我该如何使Alacritty使用TrueColor?
编辑:Chaging 术语
to xterm-256Color
无法解决问题
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最近,我偶然发现了同样的问题。我正在开发一个TMUX主题,在增加对16位颜色的支持时,我注意到颜色表示实际上并不准确地适合原始值。
我找到了在此页面 @andersevenrud上,我可以在@andersevenrud上提供更多详细的解释,从而帮助我提供了
解决方案
进行了 如果这对您没有帮助,我鼓励您访问@andersevenrud 发现替代配置。
Recently, I stumbled upon the same problem. I was developing a tmux theme, and while adding support for 16-bit colors, I noticed the color representation was not actually accurate to the original values.
I found the solution that helped me on this page where @andersevenrud provides a more detailed explanation with other commenters who also post alternative configurations.
Solution
This was enough to finally get a correct representation of the colors. If this does not help you, I would encourage you to visit @andersevenrud guide for True Color (24-bit) to discover alternative configs.
我认为问题是您的缩进:您有
normal
/bright
/dim
dim 过去primary
,但是这些需要与primary
处于相同的凹痕级别。I think the problem is your indentation: You have
normal
/bright
/dim
indented pastprimary
, but those need to be at the same indentation level asprimary
.