Bind
C++ UI toolkit for Arduino
 
Loading...
Searching...
No Matches
BindColorPicker.hpp
1#ifndef __BINDCOLORPICKER_HPP
2#define __BINDCOLORPICKER_HPP
3#include "BindView.hpp"
4#include "BindUtils.hpp"
5
53{
54
55public:
56 int16_t x = 0;
57 int16_t y = 0;
58 uint8_t cmdId = 0;
59 int16_t dimSize = 200;
60 uint8_t red = 0;
61 uint8_t green = 0;
62 uint8_t blue = 0;
63
72 uint16_t getBytes(uint8_t *out) override
73 {
74 offset = 0;
75 copyAndOffset(out, &offset, &objID, sizeof(objID));
76 copyAndOffset(out, &offset, &x, sizeof(x));
77 copyAndOffset(out, &offset, &y, sizeof(y));
78 copyAndOffset(out, &offset, &tag, sizeof(tag));
79 copyAndOffset(out, &offset, &cmdId, sizeof(cmdId));
80 copyAndOffset(out, &offset, &dimSize, sizeof(dimSize));
81 copyAndOffset(out, &offset, &red, sizeof(red));
82 copyAndOffset(out, &offset, &green, sizeof(green));
83 copyAndOffset(out, &offset, &blue, sizeof(blue));
84 return offset;
85 }
86
87private:
88 uint8_t objID = BIND_ID_COLOR_PICKER;
89 uint16_t offset = 0;
90};
91
92#endif /* __BINDCOLORPICKER_HPP */
BindColorPicker Class.
Definition BindColorPicker.hpp:53
int16_t dimSize
The dimensions (size) of the color picker.
Definition BindColorPicker.hpp:59
uint8_t cmdId
Command identifier to add or refresh the color picker. See the notes for possible cmdId values.
Definition BindColorPicker.hpp:58
uint8_t blue
The initial value for the blue component of the selected color (0-255).
Definition BindColorPicker.hpp:62
uint8_t green
The initial value for the green component of the selected color (0-255).
Definition BindColorPicker.hpp:61
uint16_t getBytes(uint8_t *out) override
Serialize the color picker object into bytes.
Definition BindColorPicker.hpp:72
int16_t y
The y-coordinate position of the color picker on the screen.
Definition BindColorPicker.hpp:57
uint8_t red
The initial value for the red component of the selected color (0-255).
Definition BindColorPicker.hpp:60
int16_t x
The x-coordinate position of the color picker on the screen.
Definition BindColorPicker.hpp:56
Definition BindView.hpp:22