6 * This code (and the devdraw interface) will have to change
7 * if we ever get bitmaps with ldepth > 3, because the
8 * colormap will have to be written in chunks
12 writecolmap(Display *d, RGB *m)
18 sprint(buf, "/dev/draw/%d/colormap", d->dirno);
19 fd = open(buf, OWRITE);
21 drawerror(d, "writecolmap: open colormap failed");
24 drawerror(d, "writecolmap: no memory");
26 for(i = 0; i < 256; i++) {
30 n += sprint(t+n, "%d %lud %lud %lud\n", 255-i, r, g, b);
36 drawerror(d, "writecolmap: bad write");