7#ifndef GHOSTTY_VT_COLOR_H
8#define GHOSTTY_VT_COLOR_H
183#define GHOSTTY_COLOR_PALETTE_MASK_WORD(index) ((index) >> 6)
192#define GHOSTTY_COLOR_PALETTE_MASK_BIT(index) (UINT64_C(1) << ((index) & 63))
202#define GHOSTTY_COLOR_PALETTE_MASK_SET(mask, index) \
203 ((mask)->bits[GHOSTTY_COLOR_PALETTE_MASK_WORD(index)] |= GHOSTTY_COLOR_PALETTE_MASK_BIT(index))
213#define GHOSTTY_COLOR_PALETTE_MASK_UNSET(mask, index) \
214 ((mask)->bits[GHOSTTY_COLOR_PALETTE_MASK_WORD(index)] &= ~GHOSTTY_COLOR_PALETTE_MASK_BIT(index))
225#define GHOSTTY_COLOR_PALETTE_MASK_IS_SET(mask, index) \
226 (((mask)->bits[GHOSTTY_COLOR_PALETTE_MASK_WORD(index)] & GHOSTTY_COLOR_PALETTE_MASK_BIT(index)) != 0)
229#define GHOSTTY_COLOR_NAMED_BLACK 0
231#define GHOSTTY_COLOR_NAMED_RED 1
233#define GHOSTTY_COLOR_NAMED_GREEN 2
235#define GHOSTTY_COLOR_NAMED_YELLOW 3
237#define GHOSTTY_COLOR_NAMED_BLUE 4
239#define GHOSTTY_COLOR_NAMED_MAGENTA 5
241#define GHOSTTY_COLOR_NAMED_CYAN 6
243#define GHOSTTY_COLOR_NAMED_WHITE 7
245#define GHOSTTY_COLOR_NAMED_BRIGHT_BLACK 8
247#define GHOSTTY_COLOR_NAMED_BRIGHT_RED 9
249#define GHOSTTY_COLOR_NAMED_BRIGHT_GREEN 10
251#define GHOSTTY_COLOR_NAMED_BRIGHT_YELLOW 11
253#define GHOSTTY_COLOR_NAMED_BRIGHT_BLUE 12
255#define GHOSTTY_COLOR_NAMED_BRIGHT_MAGENTA 13
257#define GHOSTTY_COLOR_NAMED_BRIGHT_CYAN 14
259#define GHOSTTY_COLOR_NAMED_BRIGHT_WHITE 15
GHOSTTY_API size_t ghostty_color_x11_name_count(void)
GHOSTTY_API void ghostty_color_rgb_get(GhosttyColorRgb color, uint8_t *r, uint8_t *g, uint8_t *b)
GHOSTTY_API const GhosttyColorX11Entry * ghostty_color_x11_names(void)
GHOSTTY_API double ghostty_color_perceived_luminance(GhosttyColorRgb color)
GHOSTTY_API GhosttyResult ghostty_color_parse_palette_entry(const char *value, size_t len, uint8_t *out_index, GhosttyColorRgb *out_rgb)
GHOSTTY_API void ghostty_color_palette_generate(const GhosttyColorRgb *base, const GhosttyColorPaletteMask *skip, GhosttyColorRgb bg, GhosttyColorRgb fg, bool harmonious, GhosttyColorRgb *out)
GHOSTTY_API GhosttyResult ghostty_color_parse_x11(const char *name, size_t len, GhosttyColorRgb *out)
GHOSTTY_API GhosttyResult ghostty_color_parse(const char *value, size_t len, GhosttyColorRgb *out)
uint8_t GhosttyColorPaletteIndex
GHOSTTY_API double ghostty_color_contrast(GhosttyColorRgb a, GhosttyColorRgb b)
GHOSTTY_API void ghostty_color_palette_default(GhosttyColorRgb *out)
GHOSTTY_API double ghostty_color_luminance(GhosttyColorRgb color)