refactor padding, required size. Working on colors

This commit is contained in:
Krzosa Karol
2025-01-23 09:25:41 +01:00
parent 057d6b6f50
commit 157baab5b9
7 changed files with 134 additions and 68 deletions

View File

@@ -3,13 +3,6 @@
// gb_read_only v4f32_t accent1_color_global = v4f32_rgba(243, 215, 202, 255);
// gb_read_only v4f32_t accent2_color_global = v4f32_rgba(230, 164, 180, 255);
/*
white color 0xE9F7F7 0xE9, 0xF7, 0xF7
blueish color 0xBCF7F3 0xBC, 0xF7, 0xF3
redish color 0xFB8D82 0xFB, 0x8D, 0x82
background 0x0A, 0x11, 0x17
*/
fn void mt_ui_stacks(ma_arena_t *arena, sb8_t *c, sb8_t *h) {
ast_t *table = mtt_parse(arena, __FILE__, S8_CODE(
@@ -19,13 +12,15 @@ fn void mt_ui_stacks(ma_arena_t *arena, sb8_t *c, sb8_t *h) {
{ ui_lop_t lop 1 ui_lop_cut_top }
{ f32 border_thickness 0 1.0f }
{ ui_text_align_t text_align 0 ui_text_align_left }
{ f32 required_width 0 x }
{ f32 required_height 0 x }
{ v2f32_t padding 0 x }
{ v4f32_t background_color 0 `v4f32_rgba255(245, 238, 230, 255)` }
{ v4f32_t border_color 0 `v4f32_rgba255(230, 164, 180, 255)` }
{ v4f32_t text_color 0 `v4f32_rgba255(0, 0, 0, 255)` }
{ v4f32_t radio_color 0 `v4f32_rgba255(243, 215, 202, 255)` }
{ f32 required_size 0 x }
{ f32 padding 0 x }
{ v4f32_t background_color 0 `v4f32_hsla_to_rgba((v4f32_t){0.0f, 0.2f, 0.95f, 1.0f})` }
{ v4f32_t bg_hot_color 0 `v4f32_hsla_to_rgba((v4f32_t){0.0f, 0.5f, 0.95f, 1.0f})` }
{ v4f32_t bg_active_color 0 `v4f32_hsla_to_rgba((v4f32_t){0.1f, 0.5f, 0.95f, 1.0f})` }
{ v4f32_t border_color 0 `v4f32_hsla_to_rgba((v4f32_t){0.0f, 0.2f, 0.7f, 1.0f})` }
{ v4f32_t text_color 0 `v4f32_hsla_to_rgba((v4f32_t){0.0f, 0.2f, 0.7f, 1.0f})` }
{ v4f32_t text_hot_color 0 `v4f32_hsla_to_rgba((v4f32_t){0.1f, 0.4f, 0.7f, 1.0f})` }
{ v4f32_t text_active_color 0 `v4f32_hsla_to_rgba((v4f32_t){0.1f, 0.5f, 0.7f, 1.0f})` }
));
///////////////////////////////
@@ -111,6 +106,15 @@ fn void mt_ui_stacks(ma_arena_t *arena, sb8_t *c, sb8_t *h) {
}
sb8_stmtf(c, "}");
sb8_stmtf(c, "fn void ui_box_fill_with_colors(ui_box_t *box) {");
for (ast_t *it = table->first; it; it = it->next) {
if (!s8_ends_with(mtts(it, "name"), s8_lit("_color"), false)) {
continue;
}
mt_stmtf(c, it, "box->@name = ui_top_@name();");
}
sb8_stmtf(c, "}");
}
fn void mt_ui(ma_arena_t *arena) {