3 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL
);
10 static struct colour_pair cpairs
[COLOUR_PAIRS
] = {
11 [0] = { COLOUR_WHITE
, COLOUR_BLACK
},
15 * Identify the RGB components of a given colour value
17 * @v colour colour value
18 * @v *red address to store red component
19 * @v *green address to store green component
20 * @v *blue address to store blue component
21 * @ret rc return status code
23 int colour_content ( short colour
, short *red
, short *green
, short *blue
) {
24 *red
= ( ( colour
& COLOUR_RED
) ?
1 : 0 );
25 *green
= ( ( colour
& COLOUR_GREEN
) ?
1 : 0 );
26 *blue
= ( ( colour
& COLOUR_BLUE
) ?
1 : 0 );
31 * Initialise colour pair
33 * @v pair colour pair number
34 * @v fcol foreground colour
35 * @v bcol background colour
37 int init_pair ( short pair
, short fcol
, short bcol
) {
38 struct colour_pair
*cpair
;
40 if ( ( pair
< 1 ) || ( pair
>= COLOUR_PAIRS
) )
43 cpair
= &cpairs
[pair
];
50 * Get colours of colour pair
52 * @v pair colour pair number
53 * @ret fcol foreground colour
54 * @ret bcol background colour
56 int pair_content ( short pair
, short *fcol
, short *bcol
) {
57 struct colour_pair
*cpair
;
59 if ( ( pair
< 0 ) || ( pair
>= COLOUR_PAIRS
) )
62 cpair
= &cpairs
[pair
];