Raxol.Terminal.Color.TrueColor.Detection (Raxol Terminal v2.6.0)

Copy Markdown View Source

Terminal color capability detection via environment variables.

Summary

Functions

Detects the terminal's color capability by inspecting COLORTERM and TERM env vars.

Returns true if the terminal supports 16 colors.

Returns true if the terminal supports 256 colors.

Returns true if the terminal supports 24-bit true color.

Types

terminal_capability()

@type terminal_capability() :: :true_color | :color_256 | :color_16 | :monochrome

Functions

detect()

@spec detect() :: terminal_capability()

Detects the terminal's color capability by inspecting COLORTERM and TERM env vars.

supports_16_color?()

@spec supports_16_color?() :: boolean()

Returns true if the terminal supports 16 colors.

supports_256_color?()

@spec supports_256_color?() :: boolean()

Returns true if the terminal supports 256 colors.

supports_true_color?()

@spec supports_true_color?() :: boolean()

Returns true if the terminal supports 24-bit true color.