45 {
"black", COLOR_BLACK },
46 {
"blue", COLOR_BLUE },
47 {
"cyan", COLOR_CYAN },
48 {
"green", COLOR_GREEN },
49 {
"magenta", COLOR_MAGENTA },
51 {
"white", COLOR_WHITE },
52 {
"yellow", COLOR_YELLOW },
66 {
"normal", A_NORMAL },
67 {
"reverse", A_REVERSE },
68 {
"standout", A_STANDOUT },
69 {
"underline", A_UNDERLINE },
184 unsigned long color = strtoul(s, &eptr, 10);
188 if ((*s ==
'\0') || (*eptr !=
'\0') || (color >= 256))
190 buf_printf(err,
_(
"%s: color not supported by term"), s);
225 unsigned long color = strtoul(s, &eptr, 16);
227 if ((*s ==
'\0') || !eptr || (*eptr !=
'\0') || ((eptr - s) != 6))
229 buf_printf(err,
_(
"%s: color not supported by term"), s);
290 buf_printf(err,
_(
"%s: too few arguments"),
"color");
307 if (attr == A_NORMAL)
315 buf_printf(err,
_(
"%s: too few arguments"),
"color");
330 if (!buf || !s || !ac)
335 buf_printf(err,
_(
"%s: too few arguments"),
"mono");
348 if (attr == A_NORMAL)
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
@ 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_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Color and attribute parsing.
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_ERROR
Error: Can't help the user.
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Convenience wrapper for the core headers.
static int color_debug(enum LogLevel level, const char *format,...)
enum CommandResult parse_attr_spec(struct Buffer *buf, struct Buffer *s, struct AttrColor *ac, struct Buffer *err)
Parse an attribute description - Implements parser_callback_t -.
enum CommandResult parse_color_pair(struct Buffer *buf, struct Buffer *s, struct AttrColor *ac, struct Buffer *err)
Parse a pair of colours - Implements parser_callback_t -.
Convenience wrapper for the gui headers.
@ LL_DEBUG5
Log at debug level 5.
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Convenience wrapper for the library headers.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
int parse_color_prefix(const char *s, enum ColorPrefix *prefix)
Parse a colour prefix, e.g.
const struct Mapping ColorNames[]
Mapping between a colour name and an ncurses colour.
static struct Mapping AttributeNames[]
Mapping of attribute names to their IDs.
enum CommandResult parse_color_colornnn(const char *s, struct ColorElement *elem, struct Buffer *err)
Parse a colorNNN, e.g.
enum CommandResult parse_color_name(const char *s, struct ColorElement *elem, struct Buffer *err)
Parse a colour name.
enum CommandResult parse_color_rrggbb(const char *s, struct ColorElement *elem, struct Buffer *err)
Parse an RGB colour, e.g.
enum CommandResult parse_color_namedcolor(const char *s, struct ColorElement *elem, struct Buffer *err)
Parse a named colour, e.g.
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.
Mapping between user-readable string and a constant.
const char * name
String value.