Class: Axlsx::GradientStop
- Inherits:
-
Object
- Object
- Axlsx::GradientStop
- Defined in:
- lib/axlsx/stylesheet/gradient_stop.rb
Overview
The GradientStop object represents a color point in a gradient.
Instance Attribute Summary collapse
-
#color ⇒ Color
The color for this gradient stop.
-
#position ⇒ Float
The position of the color.
Instance Method Summary collapse
-
#initialize(color, position) ⇒ GradientStop
constructor
Creates a new GradientStop object.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Constructor Details
#initialize(color, position) ⇒ GradientStop
Creates a new GradientStop object
17 18 19 20 |
# File 'lib/axlsx/stylesheet/gradient_stop.rb', line 17 def initialize(color, position) self.color = color self.position = position end |
Instance Attribute Details
#color ⇒ Color
The color for this gradient stop
8 9 10 |
# File 'lib/axlsx/stylesheet/gradient_stop.rb', line 8 def color @color end |
#position ⇒ Float
The position of the color
12 13 14 |
# File 'lib/axlsx/stylesheet/gradient_stop.rb', line 12 def position @position end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
30 31 32 33 34 |
# File 'lib/axlsx/stylesheet/gradient_stop.rb', line 30 def to_xml_string(str = '') str << ('<stop position="' << position.to_s << '">') self.color.to_xml_string(str) str << '</stop>' end |