diff options
author | okan | 2009-05-17 23:40:57 +0000 |
---|---|---|
committer | okan | 2009-05-17 23:40:57 +0000 |
commit | a83ec02263f57eac22f091d37c7e678aed7b8d38 (patch) | |
tree | 4b34676783c097eb00c55658b30e6c56c0fc8267 /font.c | |
parent | 915104a67e5e6fc2c55c6a44b9360c290ea2e61d (diff) | |
download | cwm-a83ec02263f57eac22f091d37c7e678aed7b8d38.tar.gz |
a long time coming - re-work the way we deal with colors: since we're
using Xft(3), use it to select the font color as well instead of trying
to build one; properly allocate and free colors at-will, e.g. we now
have configurable colors.
feedback and ok's todd@ and oga@
Diffstat (limited to 'font.c')
-rw-r--r-- | font.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -22,22 +22,14 @@ void font_init(struct screen_ctx *sc) { - XColor xcolor, tmp; - sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin, DefaultVisual(X_Dpy, sc->which), DefaultColormap(X_Dpy, sc->which)); if (sc->xftdraw == NULL) errx(1, "XftDrawCreate"); - if (!XAllocNamedColor(X_Dpy, DefaultColormap(X_Dpy, sc->which), - "black", &xcolor, &tmp)) - errx(1, "XAllocNamedColor"); - - sc->xftcolor.color.red = xcolor.red; - sc->xftcolor.color.green = xcolor.green; - sc->xftcolor.color.blue = xcolor.blue; - sc->xftcolor.color.alpha = 0x00ff00; - sc->xftcolor.pixel = xcolor.pixel; + if (!XftColorAllocName(X_Dpy, DefaultVisual(X_Dpy, sc->which), + DefaultColormap(X_Dpy, sc->which), "black", &sc->xftcolor)) + errx(1, "XftColorAllocName"); } int |