From af52ddac750311ace3bd997245771b26119e1659 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 8 Mar 2021 15:51:56 -0500 Subject: colorpicker for raleigh --- src/user/include/cxx/raleigh/w/colorpicker.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/user/include/cxx/raleigh/w/colorpicker.h (limited to 'src/user/include/cxx') 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 + +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 -- cgit v1.2.3