aboutsummaryrefslogtreecommitdiff
path: root/color.c
diff options
context:
space:
mode:
Diffstat (limited to 'color.c')
-rw-r--r--color.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/color.c b/color.c
new file mode 100644
index 0000000..ce69fe6
--- /dev/null
+++ b/color.c
@@ -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);
+}