NAME
colortab, colorn - define color lookup table for MEGAPIC graphic
SYNOPSIS
#include <mpict_p.h>
colortab(carg)
struct color carg[NCOLOR];
colorn(cnum, red, green, blue)
int cnum;
unsigned red, green, blue;
DESCRIPTION
colortab
colortab
defines the entries in the color lookup table for the megapic graphics
facility. The color lookup table proviedes up to 16 different colors
(with the current Megatek hardware only the even numbered entries are
available, limiting the number of different colors to 8). Each color
is defined by a mix of red, green and blue intensities ranging from 0
to 15.
carg
is a pointer to an array of NCOLOR(16) color structures of the
following form:
struct color {
unsigned red;
unsigned blue;
unsigned green;
};
Each field specifies a value of red, blue or green intensity. Each
element of the array specifies one entry in the color lookup table.
On initialization, the color lookup table contains the following:
0,0,0
1,1,1
2,2,2
3,3,3
4,4,4
5,5,5
6,6,6
7,7,7
8,8,8
9,9,9
10,10,10
11,11,11
12,12,12
13,13,13
14,14,14
15,15,15
colorn
colorn
defines a single entry of the color lookup table, indexed by
cnum. red, green, blue
specify the intensities for the red, green, and blue components
ranging from 0 to 15.
SEE ALSO
chpar(3U)
DIAGNOSTICS
colortab
and
colorn
both print an error message and return -1 if given an illegal
intensity.
colorn
prints an error message and returns -1 if given an illegal color
index.