-static unsigned long scale16to8(unsigned x)
-{
- return x*0xfful / 0xffff;
-}
-
-static unsigned long wm_pixel(const XColor *c)
-{
- return 0xff000000
- | scale16to8(c->red) << 16
- | scale16to8(c->green) << 8
- | scale16to8(c->blue);
-}
-
-static void format_row(unsigned long *row, const XColor *c,
- unsigned s, unsigned y, unsigned w, unsigned h)
-{
- unsigned x;
-
- for (x = 0; x < w; x++) {
- row[x] = wm_pixel(&c[COLOUR_PRIMARY]);
- if (x < s || y < s)
- row[x] = wm_pixel(&c[COLOUR_LIGHT]);
- if ((x+s >= w && x+y >= w) || (y+s >= h && x+y >= h))
- row[x] = wm_pixel(&c[COLOUR_DARK]);
- }
-}
+enum { ICON_16x16, ICON_24x24, ICON_32x32, ICON_48x48, ICON_MAX };