Color
The ControlColor plugin is a user interface control derived from ControlBase, designed to manage and interact with color selection in GUI applications. It allows setting and retrieving the current color value and provides a callback mechanism to notify when the color changes.
#include <interface/color/include/TellusimControlColor.h>
Example
The following example demonstrates how to use ControlColor inside a ControlDialog with a changed callback:
// create dialog
ControlDialog dialog(&root, 1);
dialog.setAlign(Control::AlignCenter);
// create title
ControlText text(&dialog, "Dialog");
text.setAlign(Control::AlignLeftTop);
// create color control
ControlColor color(&dialog, device, config);
color.setChangedCallback([](Color color, bool is_changed) {
TS_LOGT(Message, "Color: {0} {1}\n", toString(color), is_changed);
});