class Rainbow::Presenter
def background(*values)
def background(*values) wrap_with_sgr(Color.build(:background, values).codes) end
def black
def black color(:black) end
def blink
Turns on blinking attribute for this text (not well supported by terminal
def blink wrap_with_sgr(TERM_EFFECTS[:blink]) end
def blue
def blue color(:blue) end
def bright
def bright wrap_with_sgr(TERM_EFFECTS[:bright]) end
def color(*values)
def color(*values) wrap_with_sgr(Color.build(:foreground, values).codes) end
def cross_out
def cross_out wrap_with_sgr(TERM_EFFECTS[:cross_out]) end
def cyan
def cyan color(:cyan) end
def faint
Turns on faint/dark for this text (not well supported by terminal
def faint wrap_with_sgr(TERM_EFFECTS[:faint]) end
def green
def green color(:green) end
def hide
def hide wrap_with_sgr(TERM_EFFECTS[:hide]) end
def inverse
def inverse wrap_with_sgr(TERM_EFFECTS[:inverse]) end
def italic
Turns on italic style for this text (not well supported by terminal
def italic wrap_with_sgr(TERM_EFFECTS[:italic]) end
def magenta
def magenta color(:magenta) end
def method_missing(method_name, *args)
We take care of X11 color method call here.
def method_missing(method_name, *args) if Color::X11Named.color_names.include?(method_name) && args.empty? color(method_name) else super end end
def red
def red color(:red) end
def reset
It shouldn't be needed to use this method because all methods
Resets terminal to default colors/backgrounds.
def reset wrap_with_sgr(TERM_EFFECTS[:reset]) end
def respond_to_missing?(method_name, *args)
def respond_to_missing?(method_name, *args) Color::X11Named.color_names.include?(method_name) && args.empty? || super end
def underline
def underline wrap_with_sgr(TERM_EFFECTS[:underline]) end
def white
def white color(:white) end
def wrap_with_sgr(codes) #:nodoc:
def wrap_with_sgr(codes) #:nodoc: self.class.new(StringUtils.wrap_with_sgr(self, [*codes])) end
def yellow
def yellow color(:yellow) end