aboutsummaryrefslogtreecommitdiff
path: root/color.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2020-07-01 21:44:44 +0000
committerrodri <rgl@antares-labs.eu>2020-07-01 21:44:44 +0000
commitbfacf5a78ddf09baa32c8d6c23d2dfb89d59c15d (patch)
treea0e3be0418d8859b4097043105907095174f440d /color.c
parent26c7bae49165a78f3e58e0dd45244c8942a1fe22 (diff)
downloadpuppeteer-master.tar.gz
puppeteer-master.tar.bz2
puppeteer-master.zip
add better brush color management. fix issues with procrfork. replace procexecl with execl.HEADmaster
fclamp is now part of libgeometry so get rid of it.
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);
+}