Class: Houston::ColorValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hex) ⇒ ColorValue

Returns a new instance of ColorValue.



606
607
608
# File 'lib/configuration.rb', line 606

def initialize(hex)
  @hex = hex
end

Instance Attribute Details

#hexObject (readonly)

Returns the value of attribute hex.



604
605
606
# File 'lib/configuration.rb', line 604

def hex
  @hex
end

Instance Method Details

#rgbObject



614
615
616
# File 'lib/configuration.rb', line 614

def rgb
  "rgb(#{@hex.scan(/../).map { |s| s.to_i(16) }.join(", ")})"
end

#to_sObject



610
611
612
# File 'lib/configuration.rb', line 610

def to_s
  @hex
end