BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
button_painter.hpp
1#pragma once
2#include "base_painter.hpp"
3#include <bugui/labels.hpp>
4
5namespace bugui
6{
9struct button_painter final : base_painter
10{
11 explicit button_painter();
12
15 void set(labels&& l
16 , uint8_t&& r
17 , uint8_t&& g
18 , uint8_t&& b
19 , uint8_t&& a);
20
24 void set_blink(labels&& l
25 , uint8_t&& r
26 , uint8_t&& g
27 , uint8_t&& b
28 , uint8_t&& a);
29
33 void set_pulse(labels&& l
34 , uint8_t&& r
35 , uint8_t&& g
36 , uint8_t&& b
37 , uint8_t&& a);
38
40 color get_color() const { return current_color; }
41
43 labels get_label() const { return label; }
44
45private:
46 labels label{};
47};
48
49} // namespace bugui
void set(labels &&l, uint8_t &&r, uint8_t &&g, uint8_t &&b, uint8_t &&a)
Sets the the button labled l to a constant colour. see color::set.
void set_blink(labels &&l, uint8_t &&r, uint8_t &&g, uint8_t &&b, uint8_t &&a)
Sets the the button labled l to alternate between the primaray and secondary colour....
color get_color() const
Retieves the current color.
Definition button_painter.hpp:40
labels get_label() const
Retieves the current button label.
Definition button_painter.hpp:43
void set_pulse(labels &&l, uint8_t &&r, uint8_t &&g, uint8_t &&b, uint8_t &&a)
Sets the the button labled l to a smooth cycle between the primaray and secondary colour....
Generic colour class holding RGBA coloour values. The blinking and pulsing states indicate discrete o...
Definition color.hpp:14