Method: TTY::Color::Mode#mode
- Defined in:
- lib/tty/color/mode.rb
#mode ⇒ Integer
Detect supported colors
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/tty/color/mode.rb', line 41 def mode return 0 unless TTY::Color.tty? value = 8 METHODS.each do |from_check| break if (value = public_send(from_check)) != NoValue end return 8 if value == NoValue value end |