Color (gb.ncurses)
终端颜色用"color pairs"“颜色对”表示。 这些只是数字,从0到
Color.Pairs - 1 (0是所有内容的默认值),它们与前景和背景颜色相关联,并用作屏幕上字符的属性.
类似地,所有的颜色——参见这个类中代表ANSI标准颜色的颜色常量——都是从0到
Color.Colors - 1 其跟RGB值有关
The more important part, however, is that one has to stick to that number representation, especially for color pairs. You can fancily color one line of text with color pair 1 (which was previously defined by you) but as soon as you change the definition of color pair 1, the line mentioned above will change to that new definition! (BTW, you access a particular color pair through the array accessors of this class)
Having said above that 0 is the default color pair for everything, think of the
Window class... It is true for it also. So, using the
Window.Background and
Window.Foreground properties affect exactly the same color pair that was set through Window.Attributes.Color, which, in turn, is 0 per default.
I hope, it was clarified that using color will take some extra thought...
常数
静态属性
静态方法