mct
[ XITE Reference Manual | XITE home ]
Name
mct - Create a color table from ascii data.
Syntax
mct [-title <title>] [<input-file> [<output-file>]]
Description
mct creates a color table from an ascii file
of color information. The resulting colortable may be
used on 8-bit PseudoColor visuals as well as on 24-bit
composite-colormap visuals (DirectColor and TrueColor).
Each line in the file describes a color in the colortable. The
line-format is
<colornumber> <red-val> <green-val> <blue-val>
colornumber is an unsigned integer. It is used as an index to
lookup red-val, green-val and blue-val.
red-val, green-val and blue-val are the intensities of
the colors in the range 0 - 65535. A special notation
c1 r1 g1 b1
:
c2 r2 g2 b2
defines a linear stretch in the range c1 to c2, i.e.
the colornumbers in the range c1 to c2 will get red
intensities in the range r1 to r2, green in the range g1
to g2 and blue in the range b1 to b2. The ranges are
linearly interpolated.
Lines with a # in coloumn 1 are treated as comments.
Modification
The format has been modified to allow comments, starting with
a `#`, at the end of the lines. This can be used e.g. to
specify the name of the color.
Author
Otto Milvang, modified 24.07.92 Knut-Andreas Lie (allow
comments).
Revised
Svein Bøe
See also
read_colormap(3), color2ascii(1), color2ascii(3),
PrintColortable(3)
Examples
# xshow.map
# Generate colortable with "mct xshow.map xshow.col"
#
# My private colortab
# Pix 0 -> Red
# Pix 1 - 254 -> Grayscale
# Pix 255 -> Green
0 65535 0 0
1 0 0 0
:
254 65535 65535 65535
255 0 65535 0
or:
# xshow.map
# Generate colortable with "mct xshow.map xshow.col"
#
# My private colortab
0 65535 0 0 # red
1 0 0 0 # black
: # ->
254 65535 65535 65535 # white
255 0 65535 0 # green
Id
$Id: mct.c,v 1.35 1997/01/06 10:59:23 svein Exp $