Class: MyChart::Rainbow::RGBA
- Inherits:
-
Object
- Object
- MyChart::Rainbow::RGBA
- Defined in:
- lib/my_chart/rainbow.rb
Instance Method Summary collapse
- #alpha(f) ⇒ Object
-
#initialize(rgba_str) ⇒ RGBA
constructor
A new instance of RGBA.
- #to_s ⇒ Object
Constructor Details
#initialize(rgba_str) ⇒ RGBA
Returns a new instance of RGBA.
26 27 28 |
# File 'lib/my_chart/rainbow.rb', line 26 def initialize rgba_str @rgba = rgba_str end |
Instance Method Details
#alpha(f) ⇒ Object
34 35 36 |
# File 'lib/my_chart/rainbow.rb', line 34 def alpha f self.class.new @rgba.sub(/1\)/, [f, ')'].join) end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/my_chart/rainbow.rb', line 30 def to_s @rgba end |