Class: Houston::ColorValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hexObject (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

#rgbObject



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_sObject



499
500
501
# File 'lib/houston/boot/configuration.rb', line 499

def to_s
  @hex
end