Class: Houston::ColorValue
- Inherits:
-
Object
- Object
- Houston::ColorValue
- Defined in:
- lib/houston/boot/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.
495 496 497 |
# File 'lib/houston/boot/configuration.rb', line 495 def initialize(hex) @hex = hex end |
Instance Attribute Details
#hex ⇒ Object (readonly)
Returns the value of attribute hex.
493 494 495 |
# File 'lib/houston/boot/configuration.rb', line 493 def hex @hex end |
Instance Method Details
#rgb ⇒ Object
503 504 505 |
# File 'lib/houston/boot/configuration.rb', line 503 def rgb "rgb(#{@hex.scan(/../).map { |s| s.to_i(16) }.join(", ")})" end |
#to_s ⇒ Object
499 500 501 |
# File 'lib/houston/boot/configuration.rb', line 499 def to_s @hex end |