aboutsummaryrefslogtreecommitdiff
path: root/src/colorpicker.cpp
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-06-12 20:48:30 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-06-12 20:48:30 +0200
commit7756a11530d9338954922c1df8e57c66a89fbdea (patch)
tree1fc4f9f070de5b1882f5953713f27e02b66a81e5 /src/colorpicker.cpp
downloadascedit-7756a11530d9338954922c1df8e57c66a89fbdea.tar.gz
Initial commit
Diffstat (limited to 'src/colorpicker.cpp')
-rw-r--r--src/colorpicker.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/colorpicker.cpp b/src/colorpicker.cpp
new file mode 100644
index 0000000..f0eb2ea
--- /dev/null
+++ b/src/colorpicker.cpp
@@ -0,0 +1,36 @@
+#include "colorpicker.h"
+
+
+colorpicker::colorpicker()
+{
+ setSize(32,17);
+ update();
+}
+colorpicker::~colorpicker()
+{
+ destruct();
+}
+
+void colorpicker::onClick(sPos _pos, unsigned int _button)
+{
+
+}
+
+uint16_t colorpicker::getColor()
+{
+ return currentFG | (currentBG << 8);
+}
+
+void colorpicker::update()
+{
+ for (int y = 0; y < 16; y++) {
+ for (int x = 0; x < 16; x++) {
+ uint16_t xx = x, yy = y;
+ drawText(" ", {2*x,y}, _COL_WHITE | ((16u*yy + xx) << 8));
+ }
+ }
+
+ char text[17];
+ snprintf(text, 16,"asdf");
+ drawText(text, {0,16}, _COL_WHITE_BG | _COL_BLACK);
+}