class Axlsx::GradientFill
A GradientFill
defines the color and positioning for gradiant cell fill. @see Open Office XML Part 1 ยง18.8.24
Attributes
Percentage format bottom @return [Float]
Angle of the linear gradient @return [Float]
Percentage format left @return [Float]
Percentage format right @return [Float]
Collection of stop objects @return [SimpleTypedList]
Percentage format top @return [Float]
The type of gradient. @note
valid options are :linear :path
@return [Symbol]
Public Class Methods
Creates a new GradientFill
object @option options [Symbol] type @option options [Float] degree @option options [Float] left @option options [Float] right @option options [Float] top @option options [Float] bottom
# File lib/axlsx/stylesheet/gradient_fill.rb, line 17 def initialize(options={}) options[:type] ||= :linear parse_options options @stop = SimpleTypedList.new GradientStop end
Public Instance Methods
@see bottom
# File lib/axlsx/stylesheet/gradient_fill.rb, line 82 def bottom=(v) validate_format_percentage "GradientFill.bottom", v @bottom = v end
@see degree
# File lib/axlsx/stylesheet/gradient_fill.rb, line 61 def degree=(v) Axlsx::validate_float v; @degree = v end
@see left
# File lib/axlsx/stylesheet/gradient_fill.rb, line 64 def left=(v) validate_format_percentage "GradientFill.left", v @left = v end
@see right
# File lib/axlsx/stylesheet/gradient_fill.rb, line 70 def right=(v) validate_format_percentage "GradientFill.right", v @right = v end
Serializes the object @param [String] str @return [String]
# File lib/axlsx/stylesheet/gradient_fill.rb, line 95 def to_xml_string(str = '') str << '<gradientFill ' serialized_attributes str str << '>' @stop.each { |s| s.to_xml_string(str) } str << '</gradientFill>' end
@see top
# File lib/axlsx/stylesheet/gradient_fill.rb, line 76 def top=(v) validate_format_percentage "GradientFill.top", v @top = v end
@see type
# File lib/axlsx/stylesheet/gradient_fill.rb, line 58 def type=(v) Axlsx::validate_gradient_type v; @type = v end
validates that the value provided is between 0.0 and 1.0
# File lib/axlsx/stylesheet/gradient_fill.rb, line 88 def validate_format_percentage(name, value) DataTypeValidator.validate name, Float, value, lambda { |arg| arg >= 0.0 && arg <= 1.0} end