summary refs log tree commit diff
path: root/bin/color.c
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-01-28 11:04:56 -0500
committerJune McEnroe <programble@gmail.com>2018-01-28 11:05:48 -0500
commita783528346ddb3947370b5c5e0266aa186631976 (patch)
tree69e3a0c9e97e2bc6ba70e485e1f49f27f2ad8789 /bin/color.c
parentAdd fb.c (diff)
downloadsrc-a783528346ddb3947370b5c5e0266aa186631976.tar.gz
src-a783528346ddb3947370b5c5e0266aa186631976.zip
Add color.c
Diffstat (limited to '')
-rw-r--r--bin/color.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/color.c b/bin/color.c
new file mode 100644
index 00000000..3e6c3b5a
--- /dev/null
+++ b/bin/color.c
@@ -0,0 +1,13 @@
+#include <stdint.h>
+
+static uint32_t color;
+
+void draw(uint32_t *buf, uint32_t xres, uint32_t yres) {
+    for (uint32_t i = 0; i < xres * yres; ++i) {
+        buf[i] = color;
+    }
+}
+
+void input(char c) {
+    color = color << 4 | (c & 0xF);
+}