57 memset(&ac->
fg, 0,
sizeof(ac->
fg));
58 memset(&ac->
bg, 0,
sizeof(ac->
bg));
102 ac->
attrs = A_NORMAL;
155 if ((cc->
fg ==
fg) && (cc->
bg ==
bg))
249#ifdef NEOMUTT_DIRECT_COLORS
322 static const color_t basic[] = {
323 0x000000, 0x800000, 0x008000, 0x808000, 0x000080, 0x800080,
324 0x008080, 0xc0c0c0, 0x808080, 0xff0000, 0x00ff00, 0xffff00,
325 0x0000ff, 0xff00ff, 0x00ffff, 0xffffff,
334 if (!c_color_directcolor)
365 color_t normalised_color = color - 16;
366 color_t vr = (normalised_color % 216) / 36;
367 color_t vg = (normalised_color % 36) / 6;
368 color_t vb = (normalised_color % 6) / 1;
371 color_t r = (vr * 0x28) + ((vr > 0) ? (0x5f - 0x28) : 0);
372 color_t g = (vg * 0x28) + ((vg > 0) ? (0x5f - 0x28) : 0);
373 color_t b = (vb * 0x28) + ((vb > 0) ? (0x5f - 0x28) : 0);
375 color_t rgb = (r << 16) + (g << 8) + (b << 0);
383 color_t grey = (steps * 0x0a) + 0x08;
384 color_t rgb = (grey << 16) + (grey << 8) + (grey << 0);
397 if (!ac_old || !ac_new)
407#ifdef NEOMUTT_DIRECT_COLORS
420 ac_old->
fg = ac_new->
fg;
421 ac_old->
bg = ac_new->
bg;
422 ac_old->
attrs = attrs;
struct AttrColor * attr_color_list_find(struct AttrColorList *acl, color_t fg, color_t bg, int attrs)
Find an AttrColor in a list.
void attr_color_overwrite(struct AttrColor *ac_old, struct AttrColor *ac_new)
Update an AttrColor in-place.
void attr_color_clear(struct AttrColor *ac)
Free the contents of an AttrColor.
color_t color_xterm256_to_24bit(const color_t color)
Convert a xterm color to its RGB value.
bool attr_color_match(struct AttrColor *ac1, struct AttrColor *ac2)
Do the colours match?
struct AttrColor attr_color_copy(const struct AttrColor *ac)
Copy a colour.
struct AttrColor * attr_color_new(void)
Create a new AttrColor.
void attr_color_free(struct AttrColor **ptr)
Free an AttrColor.
void modify_color_by_prefix(enum ColorPrefix prefix, bool is_fg, color_t *col, int *attrs)
Modify a colour/attributes based on a prefix, e.g.
void attr_color_list_clear(struct AttrColorList *acl)
Free the contents of an AttrColorList.
bool attr_color_is_set(const struct AttrColor *ac)
Is the object coloured?
ColorPrefix
Constants for colour prefixes of named colours.
@ COLOR_PREFIX_NONE
no prefix
@ COLOR_PREFIX_ALERT
"alert" colour prefix
@ COLOR_PREFIX_LIGHT
"light" colour prefix
@ CT_SIMPLE
Simple colour, e.g. "Red".
@ CT_PALETTE
Palette colour, e.g. "color207".
Color and attribute parsing.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
int32_t color_t
Type for 24-bit colour value.
struct CursesColor * curses_color_new(color_t fg, color_t bg)
Create a new CursesColor.
void curses_color_free(struct CursesColor **ptr)
Free a CursesColor.
static int color_debug(enum LogLevel level, const char *format,...)
Convenience wrapper for the gui headers.
@ LL_DEBUG5
Log at debug level 5.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Convenience wrapper for the library headers.
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
#define TAILQ_REMOVE(head, elm, field)
A curses colour and its attributes.
struct ColorElement bg
Background colour.
struct ColorElement fg
Foreground colour.
short ref_count
Number of users.
int attrs
Text attributes, e.g. A_BOLD.
struct CursesColor * curses_color
Underlying Curses colour.
enum ColorType type
Type of Colour.
enum ColorPrefix prefix
Optional Colour Modifier.
Colour in the ncurses palette.
color_t fg
Foreground colour.
color_t bg
Background colour.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.