summaryrefslogtreecommitdiff
path: root/src/user/include/cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/include/cxx')
-rw-r--r--src/user/include/cxx/raleigh/w/colorpicker.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/user/include/cxx/raleigh/w/colorpicker.h b/src/user/include/cxx/raleigh/w/colorpicker.h
new file mode 100644
index 0000000..c33288e
--- /dev/null
+++ b/src/user/include/cxx/raleigh/w/colorpicker.h
@@ -0,0 +1,23 @@
+#ifndef RALEIGH_W_COLORPICKER_H
+#define RALEIGH_W_COLORPICKER_H
+
+#include <raleigh/widget.h>
+
+namespace raleigh {
+ class colorpicker : public widget {
+ public:
+ colorpicker(_pixel_t default_color=RGB(20, 70, 30), uint8_t resolution=4);
+ _pixel_t get_picked_color() __attribute__ ((pure));
+
+ void paint(_pixel_t *pixbuf, uint32_t pitch) override;
+ void handle_click(coord window_coords, enum mouse_packet::mouse_button click_type, bool up) override;
+ void notify_has_opaque_parent(widget *parent) override;
+
+ private:
+ _pixel_t picked_color;
+ uint8_t resolution;
+ uint8_t inv_res;
+ };
+}
+
+#endif \ No newline at end of file