Support NO_COLOR environment variable

This commit is contained in:
def 2022-02-27 09:30:15 +01:00
parent ce3539e285
commit fd44f4523a

View file

@ -3953,6 +3953,10 @@ static int color_hsv_to_windows_console_color(const ColorHSVA *hsv)
void set_console_msg_color(const void *rgbvoid) void set_console_msg_color(const void *rgbvoid)
{ {
static const char *pNoColor = getenv("NO_COLOR");
if(pNoColor)
return;
#if defined(CONF_FAMILY_WINDOWS) #if defined(CONF_FAMILY_WINDOWS)
const ColorRGBA *rgb = (const ColorRGBA *)rgbvoid; const ColorRGBA *rgb = (const ColorRGBA *)rgbvoid;
int color = 15; int color = 15;