libghostty
Loading...
Searching...
No Matches
color.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <ghostty/vt/types.h>

Go to the source code of this file.

Data Structures

struct  GhosttyColorRgb
struct  GhosttyColorPaletteMask
struct  GhosttyColorX11Entry

Macros

#define GHOSTTY_COLOR_PALETTE_MASK_WORD(index)
#define GHOSTTY_COLOR_PALETTE_MASK_BIT(index)
#define GHOSTTY_COLOR_PALETTE_MASK_SET(mask, index)
#define GHOSTTY_COLOR_PALETTE_MASK_UNSET(mask, index)
#define GHOSTTY_COLOR_PALETTE_MASK_IS_SET(mask, index)
#define GHOSTTY_COLOR_NAMED_BLACK   0
#define GHOSTTY_COLOR_NAMED_RED   1
#define GHOSTTY_COLOR_NAMED_GREEN   2
#define GHOSTTY_COLOR_NAMED_YELLOW   3
#define GHOSTTY_COLOR_NAMED_BLUE   4
#define GHOSTTY_COLOR_NAMED_MAGENTA   5
#define GHOSTTY_COLOR_NAMED_CYAN   6
#define GHOSTTY_COLOR_NAMED_WHITE   7
#define GHOSTTY_COLOR_NAMED_BRIGHT_BLACK   8
#define GHOSTTY_COLOR_NAMED_BRIGHT_RED   9
#define GHOSTTY_COLOR_NAMED_BRIGHT_GREEN   10
#define GHOSTTY_COLOR_NAMED_BRIGHT_YELLOW   11
#define GHOSTTY_COLOR_NAMED_BRIGHT_BLUE   12
#define GHOSTTY_COLOR_NAMED_BRIGHT_MAGENTA   13
#define GHOSTTY_COLOR_NAMED_BRIGHT_CYAN   14
#define GHOSTTY_COLOR_NAMED_BRIGHT_WHITE   15

Typedefs

typedef uint8_t GhosttyColorPaletteIndex

Functions

GHOSTTY_API void ghostty_color_rgb_get (GhosttyColorRgb color, uint8_t *r, uint8_t *g, uint8_t *b)
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)
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_default (GhosttyColorRgb *out)
GHOSTTY_API void ghostty_color_palette_generate (const GhosttyColorRgb *base, const GhosttyColorPaletteMask *skip, GhosttyColorRgb bg, GhosttyColorRgb fg, bool harmonious, GhosttyColorRgb *out)
GHOSTTY_API double ghostty_color_luminance (GhosttyColorRgb color)
GHOSTTY_API double ghostty_color_perceived_luminance (GhosttyColorRgb color)
GHOSTTY_API double ghostty_color_contrast (GhosttyColorRgb a, GhosttyColorRgb b)
GHOSTTY_API const GhosttyColorX11Entryghostty_color_x11_names (void)
GHOSTTY_API size_t ghostty_color_x11_name_count (void)

Detailed Description

Color types and utilities.

Definition in file color.h.