ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
sgr.h
Go to the documentation of this file.
1#pragma once
2
8
9#include <stdint.h>
10#include <stddef.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16// SGR cache initialization
18void prewarm_sgr256_cache(void);
19
20// 256-color SGR generation
21char *get_sgr256_fg_string(uint8_t fg, uint8_t *len_out);
22char *get_sgr256_bg_string(uint8_t bg, uint8_t *len_out);
23char *get_sgr256_fg_bg_string(uint8_t fg, uint8_t bg, uint8_t *len_out);
24
25// Truecolor SGR generation
26char *append_sgr_reset(char *dst);
27char *append_sgr_truecolor_fg(char *dst, uint8_t r, uint8_t g, uint8_t b);
28char *append_sgr_truecolor_bg(char *dst, uint8_t r, uint8_t g, uint8_t b);
29char *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);
30
31#ifdef __cplusplus
32}
33#endif
unsigned char uint8_t
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:116
void prewarm_sgr256_cache(void)
Prewarm 256-color foreground/background cache for benchmarks.
Definition sgr.c:95
void prewarm_sgr256_fg_cache(void)
Prewarm 256-color foreground cache for benchmarks.
Definition sgr.c:91
char * get_sgr256_bg_string(uint8_t bg, uint8_t *len_out)
Get 256-color background ANSI sequence string.
Definition sgr.c:108
char * get_sgr256_fg_string(uint8_t fg, uint8_t *len_out)
Get 256-color foreground ANSI sequence string.
Definition sgr.c:100
char * append_sgr_reset(char *dst)
Definition sgr.c:122
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:150
char * append_sgr_truecolor_bg(char *dst, uint8_t r, uint8_t g, uint8_t b)
Definition sgr.c:146
char * append_sgr_truecolor_fg(char *dst, uint8_t r, uint8_t g, uint8_t b)
Definition sgr.c:142