Visuals may have an indirect mapping off the pixel-value to a color via a programmable palette. This is e.g. true for the 8 bit IBM VGA modes. But even for "direct-mapped" modes, you will need to know which color maps to which pixel-value.
Try to cache the results of palette lookups in your application for efficiency purposes.
The ggi_color struct has 16 bit wide entries for red (.r), green (.g), and blue (.b) values. It also has an alpha value (.a>) which is unused in libggi, but allow LibGGI extensions to store an alpha value there.
Please scale your palette values as necessary.
The ggi_pixel, or the pixelvalue is a hardware-dependent representation of a color. A pixelvalue is usually obtained from a ggi_color by ggiMapColor or read from the visual by ggiGetPixel. You can safely assume that the relationship between a ggi_color and its associated ggi_pixel value does not change unless you change the visual or the mode or the palette.
You can also do calculations with ggi_pixel values. Their format is defined in Chapter 8.