Class: Kuler::Swatch

Inherits:
Object
  • Object
show all
Defined in:
lib/kuler/swatch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Swatch

create a new Kuler::Swatch from a Nokogiri::XML::Element



8
9
10
11
# File 'lib/kuler/swatch.rb', line 8

def initialize( input )
  hex = input.at( "./kuler:swatchHexColor" ).text
  @hex_code = "##{hex.downcase}"
end

Instance Attribute Details

#hex_codeObject

the hex code of the color swatch



5
6
7
# File 'lib/kuler/swatch.rb', line 5

def hex_code
  @hex_code
end