replaced confusing u64 joinded colors with struct TimStyle

This commit is contained in:
2026-01-09 09:45:00 +05:00
parent 161f655492
commit 1ce7090bd6
13 changed files with 285 additions and 181 deletions

View File

@@ -1,15 +1,20 @@
#include "tim.h"
i32 main(void) {
while (tim_run(0)) { // init state and start event loop
tim_scope(A, A, 24, 8) { // centered 24x8 scope
u64 c = 0x0a060f; // three colors
tim_frame(0, 0, ~0, ~0, c); // draw frame for scope
while (tim_run(0)) { // init state and start event loop
tim_scope(A, A, 24, 8) { // centered 24x8 scope
TimStyle c = { // three colors
.brd= TimColor16_Green,
.bg = TimColor16_DarkCyan,
.fg = TimColor16_White
};
tim_frame(0, 0, ~0, ~0, c); // draw frame for scope
tim_label("Greetings!", A, 2, A, A, c); // label in top center
if (tim_button("OK", A, ~1, 8, A, c)) // button in bottom center
return 0; // exit on button click
if (tim_is_key_press('q')) // ctrl-c is masked
return 0; // exit on 'q' press
return 0; // exit on button click
if (tim_is_key_press('q')) // ctrl-c is masked
return 0; // exit on 'q' press
}
} // atexit() cleanup
} // atexit() cleanup
return 0;
}