Module: Inkjet::Colors
- Defined in:
- lib/inkjet/colors.rb
Defined Under Namespace
Modules: Background, Foreground, Formatters, String
Constant Summary
collapse
- Colors =
%w(black red green yellow blue magenta cyan gray white)
Class Method Summary
collapse
Class Method Details
.background(color) ⇒ Object
34
35
36
|
# File 'lib/inkjet/colors.rb', line 34
def self.background(color)
"::Inkjet::Colors::Background::#{color.capitalize}".constantize rescue raise("Color does not exist: '#{color}'")
end
|
.foreground(color) ⇒ Object
30
31
32
|
# File 'lib/inkjet/colors.rb', line 30
def self.foreground(color)
"::Inkjet::Colors::Foreground::#{color.capitalize}".constantize rescue raise("Color does not exist: '#{color}'")
end
|