enum Foundation::Profile

Overview

The color capability of an output, from least to most capable. Mirrors termenv detection path from termenv.

Defined in:

foundation/profile.cr

Enum Members

NoTTY = 0
Ascii = 1
ANSI = 2
ANSI256 = 3
TrueColor = 4

Constructors

Instance Method Summary

Constructor Detail

def self.detect(io : IO = STDOUT, env : Env = LiveEnv.new) : Profile #

Detects the color profile from io's TTY status and env. Honors NO_COLOR (no-color.org) and FORCE_COLOR (force-color.org). env only needs respond to []?.


[View source]

Instance Method Detail

def ansi256? #

Returns true if this enum value equals ANSI256


[View source]
def ansi? #

Returns true if this enum value equals ANSI


[View source]
def ascii? #

Returns true if this enum value equals Ascii


[View source]
def no_tty? #

Returns true if this enum value equals NoTTY


[View source]
def true_color? #

Returns true if this enum value equals TrueColor


[View source]