43 {
"black", COLOR_BLACK },
44 {
"blue", COLOR_BLUE },
45 {
"cyan", COLOR_CYAN },
46 {
"green", COLOR_GREEN },
47 {
"magenta", COLOR_MAGENTA },
49 {
"white", COLOR_WHITE },
50 {
"yellow", COLOR_YELLOW },
64 {
"normal", A_NORMAL },
65 {
"reverse", A_REVERSE },
66 {
"standout", A_STANDOUT },
67 {
"underline", A_UNDERLINE },
182 unsigned long color = strtoul(s, &eptr, 10);
186 if ((*s ==
'\0') || (*eptr !=
'\0') || (color >= 256))
188 buf_printf(err,
_(
"%s: color not supported by term"), s);
223 unsigned long color = strtoul(s, &eptr, 16);
225 if ((*s ==
'\0') || !eptr || (*eptr !=
'\0') || ((eptr - s) != 6))
227 buf_printf(err,
_(
"%s: color not supported by term"), s);
288 buf_printf(err,
_(
"%s: too few arguments"),
"color");
305 if (attr == A_NORMAL)
313 buf_printf(err,
_(
"%s: too few arguments"),
"color");
328 if (!buf || !s || !ac)
333 buf_printf(err,
_(
"%s: too few arguments"),
"mono");
346 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?
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.
char * data
Pointer to data.
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.