diff options
Diffstat (limited to 'color.c')
-rw-r--r-- | color.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> +#include <geometry.h> +#include "dat.h" +#include "fns.h" + +Color* +newcolor(ulong col) +{ + Color *c; + + c = emalloc(sizeof(Color)); + c->v = col; + c->i = eallocimage(display, Rect(0,0,1,1), screen->chan, 1, col); + return c; +} + +void +rmcolor(Color *c) +{ + freeimage(c->i); + free(c); +} |