class SVGPlot::Gradient

SVG base gradient element, with ruby methods to describe the gradient

Public Instance Methods

fill() click to toggle source
# File lib/svgplot/gradient.rb, line 5
def fill
  "url(##{@attributes[:id]})"
end
stop(offset, color, opacity) click to toggle source
# File lib/svgplot/gradient.rb, line 9
def stop(offset, color, opacity)
  append_child(
    ChildTag.new(
      @img,
      'stop',
      'offset' => offset,
      'stop-color' => color,
      'stop-opacity' => opacity
    )
  )
end