xterm256 colors

This commit is contained in:
2026-01-13 13:06:32 +05:00
parent d68ce8d4f0
commit 75891025d0
3 changed files with 25 additions and 5 deletions

View File

@@ -17,3 +17,12 @@ typedef struct ClientCLI {
void ClientCLI_construct(ClientCLI* self);
void ClientCLI_destroy(ClientCLI* self);
Result(void) ClientCLI_run(ClientCLI* self);
enum {
Color256_White = 0xe7,
Color256_MidGray = 0xf8,
Color256_NavyBlue = 0x11,
Color256_DeepSkyBlue = 0x18,
Color256_DarkRed = 0x58,
};

View File

@@ -2,7 +2,6 @@
#include "network/tcp-chat-protocol/v1.h"
#include "tim.h"
typedef struct TextInputState {
TimEditState edit;
cstr label;
@@ -56,9 +55,21 @@ Result(bool) start_screen(Array(char) username_buf, Array(char) password_buf,
bool result = false;
StartScreenContext ctx = {
.style_default = { .brd = TimColor16_Gray, .bg = TimColor16_DarkBlue, .fg = TimColor16_Gray },
.style_focused = { .brd = TimColor16_White, .bg = TimColor16_DarkCyan, .fg = TimColor16_White },
.style_error = { .brd = TimColor16_Gray, .bg = TimColor16_DarkRed, .fg = TimColor16_White },
.style_default = {
.brd = Color256_MidGray,
.bg = Color256_NavyBlue,
.fg = Color256_MidGray
},
.style_focused = {
.brd = Color256_White,
.bg = Color256_DeepSkyBlue,
.fg = Color256_White
},
.style_error = {
.brd = Color256_MidGray,
.bg = Color256_DarkRed,
.fg = Color256_White
},
};
TimEditState_construct(&ctx.input_username.edit, username_buf.data, username_buf.len, NULL);