Module Wirble::Colorize::Color
In: lib/wirble.rb
History Shortcuts lib/wirble.rb Shortcuts Color Tokenizer Colorize RiShortcut Internals Wirble dot/m_0_0.png

Terminal escape codes for colors.

Methods

escape  

Constants

COLORS = { :nothing => '0;0', :black => '0;30', :red => '0;31', :green => '0;32', :brown => '0;33', :blue => '0;34', :cyan => '0;36', :purple => '0;35', :light_gray => '0;37', :dark_gray => '1;30', :light_red => '1;31', :light_green => '1;32', :yellow => '1;33', :light_blue => '1;34', :light_cyan => '1;36', :light_purple => '1;35', :white => '1;37', }

Public Class methods

Return the escape code for a given color.

[Source]

     # File lib/wirble.rb, line 318
318:       def self.escape(key)
319:         COLORS.key?(key) && "\033[#{COLORS[key]}m"
320:       end

[Validate]