From 095f675d402b753dc9e922f02ddb02d7b4abacd1 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Wed, 20 Sep 2023 18:57:07 +0200 Subject: [PATCH] - Color dels ui::button configurable --- source/jui.cpp | 4 ++-- source/jui.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/jui.cpp b/source/jui.cpp index 0147565..a861129 100644 --- a/source/jui.cpp +++ b/source/jui.cpp @@ -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); diff --git a/source/jui.h b/source/jui.h index 554791c..74c51ec 100644 --- a/source/jui.h +++ b/source/jui.h @@ -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); }