On May 15 2012, Lee Fallat wrote:
There is one bug. For some reason, The colors for the font are affected by
the previous color 'parsed' by XAllocNamedColor. If someone could check out
getcolor() and figure what is wrong, that'd be great. I'd really like to
make this patch *perfect* before throwing it up on suckless.
Don't know why you do the converting thingie. Why not use XftColorAllocName?
Like this (untested, but similar works in a program I wrote):
XftColor
getcolor(const char *colstr) {
XftColor color;
if(!XftColorAllocName(dpy, visual, cmap, colstr, &color))
die("error, cannot allocate color '%s'\n", colstr);
return color;
}
Also you don't need to XSetForeground before XftDrawStringUtf8 in drawtext.
David