pub const Color = enum
pub const Color = enum { /// Auto-detect whether stream supports terminal colors. auto, /// Force-enable colors. off, /// Suppress colors. on, pub fn terminalMode(color: Color) ?Io.Terminal.Mode { return switch (color) { .auto => null, .on => .escape_codes, .off => .no_color, }; } /// Determine the preference for color or no color based on the NO_COLOR and /// CLICOLOR_FORCE environment variables. Color is always disabled on WASI per /// https://github.com/WebAssembly/WASI/issues/162 pub fn settingFromEnvironment(environ_map: *const std.process.Environ.Map) Color { return if (builtin.os.tag == .wasi or EnvVar.NO_COLOR.isSet(environ_map)) .off else if (EnvVar.CLICOLOR_FORCE.isSet(environ_map)) .on else .auto; } }