ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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// 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:60
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