Because I'm a doofus : ) Damn that Xft documentation! If I only knew
XftColorAllocName existed, uuuuuhhhhhhhhhgggggg. Thanks David! I'm almost
certain from looking at that, that it will fix my problem. And yea I'm
aware of the XSetForegroundColor, : ) Thanks a bunch!

On Tue, May 15, 2012 at 9:34 PM, David Dufberg Töttrup <[email protected]>wrote:

> 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
>
>

Reply via email to