BindColorPicker Class. More...
#include <BindColorPicker.hpp>
Public Member Functions | |
void | setCallback (void(*callback)(uint8_t, uint8_t, uint8_t)) |
Set the Callback function for the color picker. | |
void | invokeCallback (uint8_t redIn, uint8_t greenIn, uint8_t blueIn) |
uint16_t | getBytes (uint8_t *out) override |
Serialize the color picker object into bytes. | |
Public Attributes | |
int16_t | x = 0 |
The x-coordinate position of the color picker on the screen. | |
int16_t | y = 0 |
The y-coordinate position of the color picker on the screen. | |
uint8_t | cmdId = 0 |
Command identifier to add or refresh the color picker. See the notes for possible cmdId values. | |
int16_t | dimSize = 200 |
The dimensions (size) of the color picker. | |
uint8_t | red = 0 |
The initial value for the red component of the selected color (0-255). | |
uint8_t | green = 0 |
The initial value for the green component of the selected color (0-255). | |
uint8_t | blue = 0 |
The initial value for the blue component of the selected color (0-255). | |
![]() | |
int16_t | tag |
BindColorPicker Class.
The BindColorPicker
class is part of the Bind framework for Arduino, designed to facilitate the creation of interactive user interface elements. Specifically, it represents a color picker element that can be displayed and controlled on the BindCanvas Android app interface.
This class allows you to define a color picker's properties, including its position, size, and the initial RGB color values. You can synchronize these properties with BindCanvas to provide a visual color selection component in your Arduino projects.
To use the BindColorPicker
class effectively, you can set its attributes such as the position (x and y coordinates), dimensions (size), and initial color (red, green, and blue values). The cmdId
parameter specifies whether to add the color picker to the BindCanvas or refresh an existing one.
Additionally, you should regularly call bind.sync()
in your main loop to ensure that the color picker reflects the user interactions and properly calls the colorPicker callback
Example usage:
|
inlineoverridevirtual |
Serialize the color picker object into bytes.
This function serializes the color picker object into a byte array, allowing it to be sent and displayed on BindCanvas.
out | A pointer to the byte array where the serialized data will be stored. |
Reimplemented from BindView.
|
inline |