Ncurses中的其他颜色是什么?

7
我正在使用ncurses并尝试在屏幕上绘制马里奥,但我无法获得一些颜色。我不知道这是否真的可能,但我想创建新的颜色,比如COLOR_SKIN,并为其设置RGB代码。
如果无法在ncurses中实现此目标,还有其他方法吗?
这是图片:

1
检查 ccc terminfo 功能。 - Ignacio Vazquez-Abrams
1个回答

3
您可能会发现这很有用:

10.2. Changing Color Definitions

The function init_color() can be used to change the rgb values for the colors defined by curses initially. Say you wanted to lighten the intensity of red color by a minuscule. Then you can use this function as

init_color(COLOR_RED, 700, 0, 0);
/* param 1     : color name
 * param 2, 3, 4 : rgb content min = 0, max = 1000 */

来源: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html

此外,马里奥的手(靠近头部)需要再高一个像素,因为他是用手而不是头撞击方块。


请注意,调用 start_color() 后,您可能能够支持更多的颜色 -- 检查全局变量 COLORS,如果它大于8,则可以使用颜色编号8及更高,而无需更改预定义的颜色。 - Chris Dodd
好的,但这样我会编辑一个颜色。我想要的是创建一个颜色。 例如:color_skin = (一个RGB值)。 - user3889483
init_color 只有在终端可以更改颜色(即 can_change_colors)时才有用。 - Thomas Dickey

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接