ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
sgr.h
Go to the documentation of this file.
1#pragma once
2
9#include <stdint.h>
10#include <stddef.h>
11
12// SGR cache initialization
14void prewarm_sgr256_cache(void);
15
16// 256-color SGR generation
17char *get_sgr256_fg_string(uint8_t fg, uint8_t *len_out);
18char *get_sgr256_bg_string(uint8_t bg, uint8_t *len_out);
19char *get_sgr256_fg_bg_string(uint8_t fg, uint8_t bg, uint8_t *len_out);
20
21// Truecolor SGR generation
22char *append_sgr_reset(char *dst);
23char *append_sgr_truecolor_fg(char *dst, uint8_t r, uint8_t g, uint8_t b);
24char *append_sgr_truecolor_bg(char *dst, uint8_t r, uint8_t g, uint8_t b);
25char *append_sgr_truecolor_fg_bg(char *dst, uint8_t fr, uint8_t fg, uint8_t fb, uint8_t br, uint8_t bg, uint8_t bb);
unsigned char uint8_t
Definition common.h:56
char * get_sgr256_fg_bg_string(uint8_t fg, uint8_t bg, uint8_t *len_out)
Get 256-color foreground/background ANSI sequence string.
Definition sgr.c:150
void prewarm_sgr256_cache(void)
Prewarm 256-color foreground/background cache for benchmarks.
Definition sgr.c:129
void prewarm_sgr256_fg_cache(void)
Prewarm 256-color foreground cache for benchmarks.
Definition sgr.c:125
char * get_sgr256_bg_string(uint8_t bg, uint8_t *len_out)
Get 256-color background ANSI sequence string.
Definition sgr.c:142
char * get_sgr256_fg_string(uint8_t fg, uint8_t *len_out)
Get 256-color foreground ANSI sequence string.
Definition sgr.c:134
char * append_sgr_reset(char *dst)
Definition sgr.c:156
char * append_sgr_truecolor_fg_bg(char *dst, uint8_t fr, uint8_t fg, uint8_t fb, uint8_t br, uint8_t bg, uint8_t bb)
Definition sgr.c:286
char * append_sgr_truecolor_bg(char *dst, uint8_t r, uint8_t g, uint8_t b)
Definition sgr.c:225
char * append_sgr_truecolor_fg(char *dst, uint8_t r, uint8_t g, uint8_t b)
Definition sgr.c:164