FVWM: Lack of free color cells, ideas

From: Santeri Paavolainen <santtu_at_ufolabs.fi>
Date: Fri, 22 Aug 1997 21:41:47 +0300 (EET DST)

On Fri, 22 Aug 1997, Brian Sayatovic wrote:
> As far as sharing a single colormap, I feel your pain. I wrote a combination C
> program and perl script to process my pixmaps to a standard colormap. I simply
> generated a complete color spectrum to the reoslution of 128 colors, and
> openened each pixmap, found the closest shade in the new spectrum to the one in
> the pixmap and replaced it.

As a related note, I have been thinking about hacking Xpm library a
little, so it would handle better with small colormaps (that is 8 bit
displays).

The basic idea would be to have some value of "colormap fullness",
which libXpm would determine before allocating a new color. It would
then scan the current colormap and find the closest color match. Next,
based on the "fullness" value it would either re-use the closest found
color or choose to allocate a new cell from the colormap.

The effect would be something like that as the colormap gets more and
more crowded Xpm would accept "less close" colors than with an empty
colormap, until at some threshold value it wouldn't allocate any new
color cells and would re-use existing, no matter how "far" the "best"
color match would be. (You could leave something like 64 colors not to
be allocate by Xpm, so there would then be some cells free for random
applications.)

If you started with pre-allocated colormap portion (with xstdcmap -all)
then Xpm would prefer to choose colors from the pre-allocated colormap
portion before trying to allocate its own.. even better.

I have not had the time to pursue the idea, so if anyone would like to
do something similar, feel free to do so.

--
santtu_at_iki.fi                    I have become death, destroyer of the worlds.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Fri Aug 22 1997 - 13:42:48 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:00 BST