Module: Philiprehberger::Color::Detection
- Defined in:
- lib/philiprehberger/color/detection.rb
Class Method Summary collapse
Class Method Details
.enabled? ⇒ Boolean
6 7 8 9 10 11 |
# File 'lib/philiprehberger/color/detection.rb', line 6 def self.enabled? return true if ENV.key?('FORCE_COLOR') return false if ENV.key?('NO_COLOR') $stdout.respond_to?(:tty?) && $stdout.tty? end |
.truecolor? ⇒ Boolean
13 14 15 |
# File 'lib/philiprehberger/color/detection.rb', line 13 def self.truecolor? %w[truecolor 24bit].include?(ENV['COLORTERM']&.downcase) end |