Method: Pastel::Color#code
- Defined in:
- lib/pastel/color.rb
#code(*colors) ⇒ Array[String]
Return raw color code without embeding it into a string.
148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/pastel/color.rb', line 148 def code(*colors) attribute = [] colors.each do |color| value = ANSI::ATTRIBUTES[color] || ALIASES[color] if value attribute << value else validate(color) end end attribute end |