class Axlsx::GradientStop
The GradientStop
object represents a color point in a gradient. @see Open Office XML Part 1 ยง18.8.24
Attributes
color[R]
The color for this gradient stop @return [Color] @see Color
position[R]
The position of the color @return [Float]
Public Class Methods
new(color, position)
click to toggle source
Creates a new GradientStop
object @param [Color] color @param [Float] position
# File lib/axlsx/stylesheet/gradient_stop.rb, line 18 def initialize(color, position) self.color = color self.position = position end
Public Instance Methods
color=(v)
click to toggle source
@see color
# File lib/axlsx/stylesheet/gradient_stop.rb, line 24 def color=(v) DataTypeValidator.validate "GradientStop.color", Color, v; @color=v end
position=(v)
click to toggle source
@see position
# File lib/axlsx/stylesheet/gradient_stop.rb, line 26 def position=(v) DataTypeValidator.validate "GradientStop.position", Float, v, lambda { |arg| arg >= 0 && arg <= 1}; @position = v end
to_xml_string(str = '')
click to toggle source
Serializes the object @param [String] str @return [String]
# File lib/axlsx/stylesheet/gradient_stop.rb, line 31 def to_xml_string(str = '') str << '<stop position="' << position.to_s << '">' self.color.to_xml_string(str) str << '</stop>' end