4 * Copyright (c) Tuomo Valkonen 1999-2005.
6 * Ion is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
12 #include <ioncore/common.h>
16 bool de_alloc_colour(WRootWin
*rootwin
, DEColour
*ret
, const char *name
)
24 if(XParseColor(ioncore_g
.dpy
, rootwin
->default_cmap
, name
, &c
)){
25 ok
=XAllocColor(ioncore_g
.dpy
, rootwin
->default_cmap
, &c
);
34 bool de_duplicate_colour(WRootWin
*rootwin
, DEColour in
, DEColour
*out
)
38 XQueryColor(ioncore_g
.dpy
, rootwin
->default_cmap
, &c
);
39 if(XAllocColor(ioncore_g
.dpy
, rootwin
->default_cmap
, &c
)){
47 void de_free_colour_group(WRootWin
*rootwin
, DEColourGroup
*cg
)
57 XFreeColors(ioncore_g
.dpy
, rootwin
->default_cmap
, pixels
, 5, 0);
66 void de_free_colour(WRootWin
*rootwin
, DEColour col
)
72 XFreeColors(ioncore_g
.dpy
, rootwin
->default_cmap
, pixels
, 1, 0);