Accept "bright" or "light" prefix for colors 8-15. Update error message to specify that numeric colors 0 to 15 are allowed, and verify that specified color is between 0 and 15.
Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Hm, perhaps also look for "light" or "bright" in color_name_to_teken so that e.g. "brightred" can be used. Something like
static bool color_name_to_teken(const char *name, int *val) { + int light = 0; + if (strcasecmp(name, "light") == 0) { + name += 5; + light = TC_LIGHT; + } else if (strcasecmp(name, "bright") == 0) { + name += 6; + light = TC_LIGHT; + } if (strcasecmp(name, "black") == 0) { - *val = TC_BLACK; + *val = light | TC_BLACK; return (true); }
We could then also remove the special case for white background:
/* Improve visibility */ if (a.ta_bgcolor == TC_WHITE) a.ta_bgcolor |= TC_LIGHT;
and just let the user specify 15 or brightwhite
Comment Actions
Seems reasonable to me, this highlights some unshared code that perhaps should be shared, though that's 'feedback' not 'you gotta make this change'
stand/efi/libefi/efi_console.c | ||
---|---|---|
438 | It would be nice if this code could be shared. |