Colormaps are used to store the mappings between the RGB values you ask for and the actual,
hardware-dependent values used to display those colors.
$colormap->alloc_colors methods do the necessary work to allocate a color within the visual; this actually has nothing to do with memory management,
so it is important that you call
$colormap->free_colors to release those spots in the colormap allocated by
Gdk's colors are 16-bit RGB values -- that is, the red, green, and blue components are integer values from 0 to 65535, with 65535 meaning full saturation. If you are used to dealing with colors on the range of 0 to 255, just scale those numbers by a factor of 257 (yes, 257).