Class: Houston::ColorValue
- Inherits:
-
Object
- Object
- Houston::ColorValue
- Defined in:
- lib/configuration.rb
Instance Attribute Summary collapse
-
#hex ⇒ Object
readonly
Returns the value of attribute hex.
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.
606 607 608 |
# File 'lib/configuration.rb', line 606 def initialize(hex) @hex = hex end |
Instance Attribute Details
#hex ⇒ Object (readonly)
Returns the value of attribute hex.
604 605 606 |
# File 'lib/configuration.rb', line 604 def hex @hex end |
Instance Method Details
#rgb ⇒ Object
614 615 616 |
# File 'lib/configuration.rb', line 614 def rgb "rgb(#{@hex.scan(/../).map { |s| s.to_i(16) }.join(", ")})" end |
#to_s ⇒ Object
610 611 612 |
# File 'lib/configuration.rb', line 610 def to_s @hex end |