void RrColorFree(RrColor *c)
{
if (c) {
+ if (c->pixel) XFreeColors(RrDisplay(c->inst), RrColormap(c->inst),
+ &c->pixel, 1, 0);
if (c->gc) XFreeGC(RrDisplay(c->inst), c->gc);
g_free(c);
}
{
return c->pixel;
}
+
+GC RrColorGC(RrColor *c) /* XXX make this const RrColor* when the GCs are in
+ a cache.. if possible? */
+{
+ if (!c->gc)
+ RrColorAllocateGC(c);
+ return c->gc;
+}