Navigation: home » code » svgalibswatches
Table of Contents

SVGAlib colour swatches

This example code simply presents a swatch of each colour from 0 to 16 along with their corresponding RGB value, rendered by SVGAlib. It was written to facilitate converting a program from C/SVGAlib to Java.

The source also demonstrates basic SVGAlib functions for setting resolution, writing text to the screen and setting pixel colours.

To compile:

# gcc -lvga -lvgagl colourswatch.c -o colourswatch

The RGB values given by this program are not perfect, most likely due to conversion from a 6 bit palette to 8 bit ints. The figures given are however very close to the actual values. If anybody can suggest a fix, please contact me.

Screenshots

Download

The files available for this release are below.

File Description
colourswatch.cC Source - The C source for the program.