Module: Sai::Terminal::Capabilities Private

Defined in:
lib/sai/terminal/capabilities.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Detect the color capabilities of the terminal

Author:

Since:

  • 0.1.0

Class Method Summary collapse

Class Method Details

.detect_color_support ⇒ Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Detect the color capabilities of the current terminal

Returns:

Author:

Since:

  • 0.1.0



24
25
26
27
28
29
30
31
32
# File 'lib/sai/terminal/capabilities.rb', line 24

def detect_color_support
  return ColorMode::NO_COLOR if no_color?
  return ColorMode::TRUE_COLOR if true_color?
  return ColorMode::ADVANCED if advanced?
  return ColorMode::ANSI if ansi?
  return ColorMode::BASIC if basic?

  ColorMode::NO_COLOR
end