我可以仅使用序列Esc[Value,Valuem设置背景的棕色吗? (不仅是黑色,红色,绿色,黄色,蓝色,洋红色,青色,白色……我想使用更多颜色).
Can I use only the sequence Esc[Value,Valuem to set the brown color of background? (not only Black, Red, Green, Yellow, Blue, Magenta, Cyan, White... I want use more colors).
如何轻松实施?我想在启动代码中实现它,所以我没有机会使用标准库.
How to implement it easily? I want to implement it in my boot code, so I haven't the opportunity to use standard libraries.
我应该使用哪个参数?
Which parameters should I use?
推荐答案ANSI仅定义了8种颜色.没有一个是 brown (尽管有些人称非明亮的黄色"为棕色",例如).
ANSI defined only 8 colors. None are brown (though some people call the non-bright "yellow" a "brown", e.g., Yellow appears as brown in konsole).
如果要在Linux 引导代码中使用不同的颜色,则可以使用Linux控制台调色板转义序列来更改控制台调色板中的一项.参考 console_codes(4)手册页:
If you want to use different colors in your Linux boot code, you could use the Linux console color palette escape sequence to alter one of the entries in the console's palette. Referring to console_codes(4) manual page:
ESC ] OSC (Should be: Operating system command) ESC ] P nrrggbb: set palette, with parameter given in 7 hexadecimal digits after the final P :-(. Here n is the color (0-15), and rrggbb indicates the red/green/blue values (0-255). ESC ] R: reset palette有人使用此功能编写了程序(或脚本),例如 setcolors- .
Some people have written programs (or scripts) using this feature, e.g., setcolors - Change your Linux VT color palette (at boot time too!).
要在终端仿真器中更改颜色,例如,在启动并登录到桌面后,这些其他终端可能具有用于在其调色板中设置条目的控制序列.
To alter colors in terminal emulators, e.g., after booting and logging into your desktop, these other terminals may have control sequences for setting entries in their color palettes.
更多推荐
如何使用ANSI转义序列设置棕色?
发布评论