Class: Houston::ColorValue

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

Instance Method Summary collapse

Constructor Details

#initialize(hex) ⇒ ColorValue

Returns a new instance of ColorValue.



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

def initialize(hex)
  @hex = hex
end

Instance Method Details

#rgbObject



612
613
614
# File 'lib/configuration.rb', line 612

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

#to_sObject



608
609
610
# File 'lib/configuration.rb', line 608

def to_s
  @hex
end