56 if (ac->
attrs & A_BLINK)
58 if (ac->
attrs & A_BOLD)
62 if (ac->
attrs == A_NORMAL)
64 if (ac->
attrs & A_REVERSE)
66 if (ac->
attrs & A_STANDOUT)
68 if (ac->
attrs & A_UNDERLINE)
89 int r = (ac->
fg.
color >> 16) & 0xff;
90 int g = (ac->
fg.
color >> 8) & 0xff;
91 int b = (ac->
fg.
color >> 0) & 0xff;
116 int r = (ac->
bg.
color >> 16) & 0xff;
117 int g = (ac->
bg.
color >> 8) & 0xff;
118 int b = (ac->
bg.
color >> 0) & 0xff;
137 static char text[64];
143 pos += snprintf(text + pos,
sizeof(text) - pos,
"blink ");
145 pos += snprintf(text + pos,
sizeof(text) - pos,
"bold ");
147 pos += snprintf(text + pos,
sizeof(text) - pos,
"italic ");
148 if (attrs & A_REVERSE)
149 pos += snprintf(text + pos,
sizeof(text) - pos,
"reverse ");
150 if (attrs & A_STANDOUT)
151 pos += snprintf(text + pos,
sizeof(text) - pos,
"standout ");
152 if (attrs & A_UNDERLINE)
153 pos += snprintf(text + pos,
sizeof(text) - pos,
"underline ");
174 const char *prefix = NULL;
192 snprintf(buf, buflen,
"%s%s", prefix, name);
198 if (elem->
color < 256)
199 snprintf(buf, buflen,
"color%d", elem->
color);
201 snprintf(buf, buflen,
"BAD:%d", elem->
color);
207 int r = (elem->
color >> 16) & 0xff;
208 int g = (elem->
color >> 8) & 0xff;
209 int b = (elem->
color >> 0) & 0xff;
210 snprintf(buf, buflen,
"#%02x%02x%02x", r, g, b);
229 char color_fg[64] = { 0 };
230 char color_bg[64] = { 0 };
233 for (
int i = 0; i < num; i++)
259 char color_fg[64] = { 0 };
260 char color_bg[64] = { 0 };
288 buf_add_printf(buf,
"color %-16s %-20s %-16s %-16s %-30s # %s\n", name,
308 char color_fg[64] = { 0 };
309 char color_bg[64] = { 0 };
371 buf_add_printf(buf,
"color compose %-18s %-20s %-16s %-16s # %s\n", name,
391 char color_fg[64] = { 0 };
392 char color_bg[64] = { 0 };
426 buf_add_printf(buf,
"color status %-20s %-16s %-16s %-30s # %s\n",
434 buf_add_printf(buf,
"color status %-20s %-16s %-16s %-28s %d # %s\n",
474#ifdef USE_DEBUG_COLOR
bool attr_color_is_set(const struct AttrColor *ac)
Is the object coloured?
@ COLOR_PREFIX_ALERT
"alert" colour prefix
@ COLOR_PREFIX_LIGHT
"light" colour prefix
@ COLOR_PREFIX_BRIGHT
"bright" colour prefix
@ CT_SIMPLE
Simple colour, e.g. "Red".
@ CT_PALETTE
Palette colour, e.g. "color207".
@ CT_RGB
True colour, e.g. "#11AAFF".
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
void simple_colors_dump(struct Buffer *buf)
Dump all the Simple colours.
void color_log_color_attrs(struct AttrColor *ac, struct Buffer *swatch)
Get a colourful string to represent a colour in the log.
const char * color_log_name(char *buf, int buflen, struct ColorElement *elem)
Get a string to represent a colour name.
void quoted_colors_dump(struct Buffer *buf)
Dump all the Quoted colours.
void regex_colors_dump(struct Buffer *buf)
Dump all the Regex colours.
void color_dump(void)
Display all the colours in the Pager.
const char * color_log_attrs_list(int attrs)
Get a string to represent some attributes in the log.
void status_colors_dump(struct Buffer *buf)
Dump all the Status colours.
struct RegexColorList * regex_colors_get_list(enum ColorId cid)
Return the RegexColorList for a colour id.
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Color and attribute parsing.
const struct Mapping ComposeColorFields[]
Mapping of compose colour names to their IDs.
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
ColorId
List of all coloured objects.
@ MT_COLOR_STATUS
Status bar (takes a pattern)
@ MT_COLOR_NONE
No colour.
size_t pretty_var(const char *str, struct Buffer *buf)
Escape and stringify a config item value.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void ansi_colors_dump(struct Buffer *buf)
Dump all the ANSI colours.
void curses_colors_dump(struct Buffer *buf)
Dump all the Curses colours.
void merged_colors_dump(struct Buffer *buf)
Dump all the Merged colours.
size_t mutt_file_save_str(FILE *fp, const char *str)
Save a string to a file.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
Convenience wrapper for the gui headers.
#define log_multiline(LEVEL, STRING)
@ LL_DEBUG1
Log at debug level 1.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Convenience wrapper for the library headers.
const struct Mapping ColorNames[]
Mapping between a colour name and an ncurses colour.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define STAILQ_FOREACH(var, head, field)
#define STAILQ_EMPTY(head)
struct AttrColor * quoted_colors_get(int q)
Return the color of a quote, cycling through the used quotes.
int quoted_colors_num_used(void)
Return the number of used quotes.
#define COLOR_QUOTED(cid)
A curses colour and its attributes.
struct ColorElement bg
Background colour.
struct ColorElement fg
Foreground colour.
int attrs
Text attributes, e.g. A_BOLD.
String manipulation buffer.
enum ColorType type
Type of Colour.
enum ColorPrefix prefix
Optional Colour Modifier.
const char * name
String value.
A regular expression and a color to highlight a line.
struct AttrColor attr_color
Colour and attributes to apply.
char * pattern
Pattern to match.
int match
Substring to match, 0 for old behaviour.