Class: CssColorContrast::CommandInterpreter::Function::Info

Inherits:
CssColorContrast::CommandInterpreter::Function show all
Defined in:
lib/css_color_contrast/command_interpreter.rb

Instance Attribute Summary

Attributes inherited from CssColorContrast::CommandInterpreter::Function

#name, #params

Instance Method Summary collapse

Methods inherited from CssColorContrast::CommandInterpreter::Function

create, #initialize, #param_values, #push

Constructor Details

This class inherits a constructor from CssColorContrast::CommandInterpreter::Function

Instance Method Details

#evaluateObject



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/css_color_contrast/command_interpreter.rb', line 81

def evaluate
  colors = param_values.map {|c| Color.as_color(c) }
  out = StringIO.new

  colors.each do |c|
    out.puts '---'
    out.puts labeled_rgb_values(c)
    out.puts format_color_function(:hsl, c.hsl)
    out.puts format_color_function(:hwb, c.hwb)
  end
  out.string
end