- Color dels ui::button configurable

This commit is contained in:
2023-09-20 18:57:07 +02:00
parent b10b76d59d
commit 095f675d40
2 changed files with 3 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
namespace ui
{
const int button(const char *label, const int x, const int y, const int w, const int h)
const int button(const char *label, const int x, const int y, const int w, const int h, const int c1, const int c2, const int c3)
{
const int mx = input::mouseX();
const int my = input::mouseY();
@@ -14,7 +14,7 @@ namespace ui
const int txt_size = strlen(label)*4;
const int txt_x = x+(w-txt_size)/2;
draw::color(inside?(btnDown?15:LIGHT+TEAL):TEAL);
draw::color(inside?(btnDown?c3:c2):c1);
draw::fillrect(x, y, w, h);
draw::print(label, 1+txt_x, y+3, LIGHT+WHITE, PAPER);

View File

@@ -2,5 +2,5 @@
namespace ui
{
const int button(const char *label, const int x, const int y, const int w, const int h);
const int button(const char *label, const int x, const int y, const int w, const int h, const int c1, const int c2, const int c3);
}