1#ifndef __BINDCOLORPICKER_HPP
2#define __BINDCOLORPICKER_HPP
4#include "BindUtils.hpp"
62 this->tag = tagIndex++;
86 clickCallback = callback;
89 void invokeCallback(uint8_t redIn, uint8_t greenIn, uint8_t blueIn)
92 this->green = greenIn;
94 if (clickCallback !=
nullptr)
96 clickCallback(redIn, greenIn, blueIn);
111 copyAndOffset(out, &offset, &objID,
sizeof(objID));
112 copyAndOffset(out, &offset, &
x,
sizeof(
x));
113 copyAndOffset(out, &offset, &
y,
sizeof(
y));
114 copyAndOffset(out, &offset, &tag,
sizeof(tag));
115 copyAndOffset(out, &offset, &
cmdId,
sizeof(
cmdId));
117 copyAndOffset(out, &offset, &
red,
sizeof(
red));
118 copyAndOffset(out, &offset, &
green,
sizeof(
green));
119 copyAndOffset(out, &offset, &
blue,
sizeof(
blue));
124 uint8_t objID = BIND_ID_COLOR_PICKER;
126 static int16_t tagIndex;
127 void (*clickCallback)(uint8_t, uint8_t, uint8_t) =
nullptr;
BindColorPicker Class.
Definition BindColorPicker.hpp:56
int16_t dimSize
The dimensions (size) of the color picker.
Definition BindColorPicker.hpp:68
uint8_t cmdId
Command identifier to add or refresh the color picker. See the notes for possible cmdId values.
Definition BindColorPicker.hpp:67
uint8_t blue
The initial value for the blue component of the selected color (0-255).
Definition BindColorPicker.hpp:71
uint8_t green
The initial value for the green component of the selected color (0-255).
Definition BindColorPicker.hpp:70
uint16_t getBytes(uint8_t *out) override
Serialize the color picker object into bytes.
Definition BindColorPicker.hpp:108
void setCallback(void(*callback)(uint8_t, uint8_t, uint8_t))
Set the Callback function for the color picker.
Definition BindColorPicker.hpp:84
int16_t y
The y-coordinate position of the color picker on the screen.
Definition BindColorPicker.hpp:66
uint8_t red
The initial value for the red component of the selected color (0-255).
Definition BindColorPicker.hpp:69
int16_t x
The x-coordinate position of the color picker on the screen.
Definition BindColorPicker.hpp:65
Definition BindView.hpp:22