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.
-
- (Float) position
The position of the color.
Instance Method Summary (collapse)
-
- (GradientStop) initialize(color, position)
constructor
Creates a new GradientStop object.
-
- (String) to_xml(xml)
Serializes the gradientStop.
Constructor Details
- (GradientStop) initialize(color, position)
Creates a new GradientStop object
18 19 20 21 |
# File 'lib/axlsx/stylesheet/gradient_stop.rb', line 18 def initialize(color, position) self.color = color self.position = position end |
Instance Attribute Details
- (Color) color
The color for this gradient stop
9 10 11 |
# File 'lib/axlsx/stylesheet/gradient_stop.rb', line 9 def color @color end |
- (Float) position
The position of the color
13 14 15 |
# File 'lib/axlsx/stylesheet/gradient_stop.rb', line 13 def position @position end |
Instance Method Details
- (String) to_xml(xml)
Serializes the gradientStop
29 |
# File 'lib/axlsx/stylesheet/gradient_stop.rb', line 29 def to_xml(xml) xml.stop(:position => self.position) {self.color.to_xml(xml)} end |