SPECTRA>
show x11
displays visual type and other information about the X server.
When SPECTRA opens the graphical window, it prepares 10 standard colours. How this is done, depends on the visual type. In case of PseudoColor visuals, colour cells are allocated and filled. For TrueColor Visuals, SPECTRA creates a vector which contains pixel values. The contents of these structures can be inspected with:
SPECTRA>
show x11/ct
For PseudoColor visuals, only those cells are
shown that are allocated by SPECTRA.
Other colour cells are used by the window manager and
by applications that started earlies than SPECTRA.
The qualifier /base allows you to look at all cells.
Output primitives (line, marker or text) refer to the colour structures by an attribute called colour index (colour code, pixel). The table in section 15.3.69 shows the meaning of the colour code, e.g.: No. 0 is white, 1 is black and 2 is red, etc.
The following command shows, how colour is used.
SPECTRA>
set bpu1/col=2
The SCAN named BPU1 will be drawn with colour number 2 which
is red.
Colours may be changed, e.g.:
SPECTRA>
set colour/index=2/rgb=(255,0,30)
This command sets colour no. 2 to the maximum intensity for red (255)
plus a little blue (30). Colour intensities are always in the
range [0,255].
Colours may be resetted:
SPECTRA>
set colour/reset
This command resets the first 10 colours.
Colours can also be set for backgrounds of SCANs, TEXTs or the entire workstation. Here is an example:
! ! set workstation to 'portrait' ! set ws view 0 0.18 0 0.25 ! ! set the backgoud colour to GREY50 ! set bg 9 crea/notext cs 0 10 100 calc cs = cos(cs) ! ! set the line colour to RED, ! the SCAN backgound to GREY85 ! set cs/col=2/bg_col=8 ! ! change GREY85 to light-blue ! set col/ind=8/rgb=(190,240,255) crea/tag cs/string=cosinus ! ! Create TEXT, backgound is blue, foreground white ! crea/text cs/string="Setting Background Colours" set cs.2/y=1.08/bg=4/h_al=2/col=0 display ! ! Write coloured encapsulated postscript file and ! view it with ghostview. ! post/eps/col/gs/nocon bg_colour_example.psThe output can be found in section 10.5.
An ARRAY consists of the data components and a colour table. The ARRAY colour table is displayed by
SPECTRA>
show array_id/ct
The number of valid colour table entries is ncolour which is an item of the colour table info block. It can be changed by change arr_name or set arr_name/ncolour=val.
Offset_colour, which is also part of the info block, determines the index of the server colour table where the array colour table starts. The default offset is 10, leaving the 10 standard colours (white, black, red, green ...) undisturbed. The standard colours are used for SCANs, TEXTs and TAGs.
The array colour table is loaded into the server before the ARRAY is displayed. As a consequence: ARRAYs fight each other, if the have the same offset (the last array wins).
The data components (pixel) are interpreted as indices pointing to colour cells (PseudoColor) or and indices of the pixel array (TrueColor). The pixel values are in the range [0,ncolour - 1]. If a pixel value is outside, SPECTRA uses the mod( pixel, ncolour) function to map it into the colour space. The shift due to the offset is done by SPECTRA.
PseudoColor: If SPECTRA failes to allocate enough cells, maybe because another client allocated the cells before, you can quit the other application and restart SPECTRA or strike back by using a private colour map, e.g.:
SPECTRA>
set term 1/cmap_offset=10
This command re-opens the graphical window
using a private colour map. It leaves 10 colour cells for all the other
clients.
Private colour maps have the disadvantage that
the other windows change their colour after a SPECTRA window
has been moved on top of the window stack.