summaryrefslogtreecommitdiff
path: root/src/user/include/cxx/raleigh
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-08 15:51:56 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-08 15:51:56 -0500
commitaf52ddac750311ace3bd997245771b26119e1659 (patch)
tree332c92a654ac97601be0e0a3ad2ff06d33bd645a /src/user/include/cxx/raleigh
parent8221fd5451f094defa9866f98026b74a969f7693 (diff)
downloadportland-os-af52ddac750311ace3bd997245771b26119e1659.tar.gz
colorpicker for raleigh
Diffstat (limited to 'src/user/include/cxx/raleigh')
-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