Class: Houston::ColorValue
- Inherits:
-
Object
- Object
- Houston::ColorValue
- Defined in:
- lib/configuration.rb
Instance Method Summary collapse
-
#initialize(hex) ⇒ ColorValue
constructor
A new instance of ColorValue.
- #rgb ⇒ Object
- #to_s ⇒ Object
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
#rgb ⇒ Object
612 613 614 |
# File 'lib/configuration.rb', line 612 def rgb "rgb(#{@hex.scan(/../).map { |s| s.to_i(16) }.join(", ")})" end |
#to_s ⇒ Object
608 609 610 |
# File 'lib/configuration.rb', line 608 def to_s @hex end |