Class: SVGPalette
- Inherits:
-
Object
- Object
- SVGPalette
- Defined in:
- lib/svg_palette.rb
Constant Summary collapse
- PROPERTIES =
%w( fill stroke stop-color flood-color lighting-color style ).freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(xml_string) ⇒ SVGPalette
constructor
A new instance of SVGPalette.
- #parse ⇒ Object
Constructor Details
#initialize(xml_string) ⇒ SVGPalette
Returns a new instance of SVGPalette.
10 11 12 |
# File 'lib/svg_palette.rb', line 10 def initialize(xml_string) @xml = Nokogiri::XML(xml_string) end |
Class Method Details
.parse(xml_string) ⇒ Object
14 15 16 |
# File 'lib/svg_palette.rb', line 14 def self.parse(xml_string) new(xml_string).parse end |
Instance Method Details
#parse ⇒ Object
18 19 20 |
# File 'lib/svg_palette.rb', line 18 def parse squash(values.map { |v| CSSColor.parse(v) rescue nil }) end |