Module: Sai::ModeSelector
- Defined in:
- lib/sai/mode_selector.rb
Overview
Color mode selection methods
Class Method Summary collapse
-
.advanced ⇒ Integer
(also: color256, colour256, eight_bit, two_hundred_fifty_six_color, two_hundred_fifty_six_colour)
Set the color mode to 256 color (8-bit) mode.
-
.advanced_auto ⇒ Integer
(also: color256_auto, colour256_auto, eight_bit_auto, two_hundred_fifty_six_color_auto, two_hundred_fifty_six_colour_auto)
Automatically set the color mode to advanced (8-bit) or lower.
-
.ansi ⇒ Integer
(also: color16, colour16, four_bit, sixteen_color, sixteen_colour)
Set the color mode to 16 color (4-bit) mode.
-
.ansi_auto ⇒ Integer
(also: color16_auto, colour16_auto, four_bit_auto, sixteen_color_auto, sixteen_colour_auto)
Automatically set the color mode to ansi (4-bit) or lower.
-
.auto ⇒ Integer
(also: color16m_auto, colour16m_auto, enabled, sixteen_million_color_auto, sixteen_million_colour_auto, twenty_for_bit_auto)
Set the color mode based on the current Terminal's capabilities.
-
.basic ⇒ Integer
(also: color8, colour8, eight_color, eight_colour, three_bit)
Set the color mode to 8 color (3-bit) mode.
-
.basic_auto ⇒ Integer
(also: color8_auto, colour8_auto, eight_color_auto, eight_colour_auto, three_bit_auto)
Automatically set the color mode to basic (3-bit) or lower.
-
.no_color ⇒ Integer
(also: disabled, mono, no_colour)
Set the color mode to disable all color and styling.
-
.true_color ⇒ Integer
(also: color16m, colour16m, sixteen_million_color, sixteen_million_colour, twenty_for_bit)
Set the color mode to 16-million color (24-bit) mode.
Class Method Details
.advanced ⇒ Integer Also known as: color256, colour256, eight_bit, two_hundred_fifty_six_color, two_hundred_fifty_six_colour
Set the color mode to 256 color (8-bit) mode
29 30 31 |
# File 'lib/sai/mode_selector.rb', line 29 def advanced Terminal::ColorMode::ADVANCED end |
.advanced_auto ⇒ Integer Also known as: color256_auto, colour256_auto, eight_bit_auto, two_hundred_fifty_six_color_auto, two_hundred_fifty_six_colour_auto
Automatically set the color mode to advanced (8-bit) or lower
Sets the terminal color mode to advanced (8-bit) support, which provides 256 colors The mode will automatically downgrade to 4-bit, 3-bit, or NO_COLOR if the terminal doesn't support advanced colors
78 79 80 |
# File 'lib/sai/mode_selector.rb', line 78 def advanced_auto [Terminal::Capabilities.detect_color_support, Terminal::ColorMode::ADVANCED].min end |
.ansi ⇒ Integer Also known as: color16, colour16, four_bit, sixteen_color, sixteen_colour
Set the color mode to 16 color (4-bit) mode
101 102 103 |
# File 'lib/sai/mode_selector.rb', line 101 def ansi Terminal::ColorMode::ANSI end |
.ansi_auto ⇒ Integer Also known as: color16_auto, colour16_auto, four_bit_auto, sixteen_color_auto, sixteen_colour_auto
Automatically set the color mode to ansi (4-bit) or lower
Sets the terminal color mode to ansi (4-bit) support, which provides 8 colors The mode will automatically downgrade to 3-bit or NO_COLOR if the terminal doesn't support ansi colors
143 144 145 |
# File 'lib/sai/mode_selector.rb', line 143 def ansi_auto [Terminal::Capabilities.detect_color_support, Terminal::ColorMode::ANSI].min end |
.auto ⇒ Integer Also known as: color16m_auto, colour16m_auto, enabled, sixteen_million_color_auto, sixteen_million_colour_auto, twenty_for_bit_auto
Set the color mode based on the current Terminal's capabilities
This is the default color mode for Sai
186 187 188 |
# File 'lib/sai/mode_selector.rb', line 186 def auto Terminal::Capabilities.detect_color_support end |
.basic ⇒ Integer Also known as: color8, colour8, eight_color, eight_colour, three_bit
Set the color mode to 8 color (3-bit) mode
210 211 212 |
# File 'lib/sai/mode_selector.rb', line 210 def basic Terminal::ColorMode::BASIC end |
.basic_auto ⇒ Integer Also known as: color8_auto, colour8_auto, eight_color_auto, eight_colour_auto, three_bit_auto
Automatically set the color mode to basic (3-bit) or lower
Sets the terminal color mode to basic (3-bit) support, which provides 8 colors The mode will automatically downgrade to NO_COLOR if the terminal doesn't support basic colors
244 245 246 |
# File 'lib/sai/mode_selector.rb', line 244 def basic_auto [Terminal::Capabilities.detect_color_support, Terminal::ColorMode::BASIC].min end |
.no_color ⇒ Integer Also known as: disabled, mono, no_colour
Set the color mode to disable all color and styling
267 268 269 |
# File 'lib/sai/mode_selector.rb', line 267 def no_color Terminal::ColorMode::NO_COLOR end |
.true_color ⇒ Integer Also known as: color16m, colour16m, sixteen_million_color, sixteen_million_colour, twenty_for_bit
Set the color mode to 16-million color (24-bit) mode
288 289 290 |
# File 'lib/sai/mode_selector.rb', line 288 def true_color Terminal::ColorMode::TRUE_COLOR end |