Class: String
Instance Method Summary collapse
- #colour(newcolour, *colours) ⇒ Object (also: #color)
Instance Method Details
#colour(newcolour, *colours) ⇒ Object Also known as: color
104 105 106 107 |
# File 'lib/rcl/ext/ansicolour.rb', line 104 def colour(newcolour, *colours) attr = Term::ANSIColour.attributes [newcolour, colours].flatten.map {|c| "\e\[#{attr[c]}m"}.join + self.to_s + "\e\[#{attr['reset']}m" end |