4 // TODO: free colors again
7 rxvt_color::set (rxvt_term *t, Pixel p)
13 if (!XQueryColor (t->Xdisplay, t->Xcmap, &xc))
24 XftColorAllocValue (t->Xdisplay,
37 rxvt_color::set (rxvt_term *t, const char *name)
41 if (XParseColor (t->Xdisplay, t->Xcmap, name, &xc))
42 return set (t, xc.red, xc.green, xc.blue);
48 rxvt_color::set (rxvt_term *t, unsigned short cr, unsigned short cg, unsigned short cb)
55 xc.flags = DoRed | DoGreen | DoBlue;
57 if (XAllocColor (t->Xdisplay, t->Xcmap, &xc))
58 return set (t, xc.pixel);
64 rxvt_color::get (rxvt_term *t, unsigned short &cr, unsigned short &cg, unsigned short &cb)
74 XQueryColor (t->Xdisplay, t->Xcmap, &c);