Home > comp > gb.ncurses > color 
 en fr de es it nl pl pt pt_BR mk sq ca cs tr ar fa id vi ko ja ru zh zh_TW eo
Previous  Next  Edit  Rename  Undo  Search  Administration  
Documentation  
Warning! This page is not translated.  See english version 
Color (gb.ncurses)
Terminal color is represented by means of "color pairs". These are just numbers, from 0 to Color.Pairs - 1 (0 being the default for everything) that are associated a foreground and a background color and are used as attributes to characters on the screen.
Similarly, all colors - see the color constants in this class which represent the ANSI standard ones - are just numbers from 0 to Color.Colors - 1 which are, again, connected to RGB values.

The more important part, however, is, that one has to stick to that number representation, especially of 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 either. So using the Window.Background and Window.Foreground properties affect exactly the 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 thoughts...

Symbols
This class is static.
This class acts like a read-only array.

Static properties  Static methods  Constants 
./available  ./canchange  ./count    ./set    Black  Blue  Cyan  Green  Magenta  Red  White  Yellow