/* We only check for the presence of the variable; value is ignored. */
cached_color_mode = COLOR_OFF;
+ else if (STRPTR_IN_SET(getenv("COLORTERM"),
+ "truecolor",
+ "24bit"))
+ cached_color_mode = COLOR_24BIT;
+
else if (getpid_cached() == 1)
/* PID1 outputs to the console without holding it open all the time.
*
/* Limits the use of ANSI colors to a subset. */
typedef enum ColorMode {
/* No colors, monochrome output. */
- COLOR_OFF = 0,
+ COLOR_OFF,
/* All colors, no restrictions. */
- COLOR_ON = 1,
+ COLOR_ON,
/* Only the base 16 colors. */
- COLOR_16 = 16,
+ COLOR_16,
/* Only 256 colors. */
- COLOR_256 = 256,
+ COLOR_256,
+
+ /* For truecolor or 24bit color support.*/
+ COLOR_24BIT,
_COLOR_INVALID = -EINVAL,
} ColorMode;