Module: Wirb::Colorizer::Wirb0_Paint

Defined in:
lib/wirb/colorizer/wirb0_paint.rb

Class Method Summary collapse

Class Method Details

.color(*color_args) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
# File 'lib/wirb/colorizer/wirb0_paint.rb', line 60

def self.color(*color_args)
  if color_args.first && color_args.size == 1 && color_args.first.is_a?(Symbol)
    if color_args.first == :paint # force usage of paint colors
      Paint[string, *color_args[1..-1]]
    else
      Paint::Wirb.send(color_args.first)
    end
  else
    Paint.color(*color_args)
  end
end

.run(string, *color_args) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/wirb/colorizer/wirb0_paint.rb', line 48

def self.run(string, *color_args)
  if color_args.first && color_args.size == 1 && color_args.first.is_a?(Symbol)
    if color_args.first == :paint # force usage of paint colors
      Paint[string, *color_args[1..-1]]
    else
      Paint::Wirb.send(color_args.first, string)
    end
  else
    Paint[string, *color_args]
  end
end