- if(!name) {
- if(BETWEEN(x, 16, 16 + 215)) { /* 256 color */
- color.red = sixd_to_16bit( ((x-16)/36)%6 );
- color.green = sixd_to_16bit( ((x-16)/6) %6 );
- color.blue = sixd_to_16bit( ((x-16)/1) %6 );
- if(!XftColorAllocValue(xw.dpy, xw.vis,
- xw.cmap, &color, &ncolor)) {
- return 1;
- }
-
- XftColorFree(xw.dpy, xw.vis, xw.cmap, &dc.col[x]);
- dc.col[x] = ncolor;
- return 0;
- } else if(BETWEEN(x, 16 + 216, 255)) { /* greyscale */
- color.red = color.green = color.blue = \
- 0x0808 + 0x0a0a * (x - (16 + 216));
- if(!XftColorAllocValue(xw.dpy, xw.vis,
- xw.cmap, &color, &ncolor)) {
- return 1;
- }