Method: Clutter::Color.parse

Defined in:
lib/clutter/color.rb

.parse(string) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/clutter/color.rb', line 69

def parse(string)
  if respond_to?(:from_string, true)
    succeeded, color = from_string(string)
  else
    color = new
    succeeded = color.from_string(string)
  end
  unless succeeded
    raise ArgumentError, "invalid color string: <#{string}>"
  end
  color
end