### Home Classes Methods

### In Files

- lib/prawn/graphics/patterns.rb

### Methods

- #fill_gradient
- #stroke_gradient

### Class/Module Index

Quicksearch

- Prawn
- Prawn::Configurable
- Prawn::Document
- Prawn::Document::BoundingBox
- Prawn::Document::ColumnBox
- Prawn::Document::GraphicsState
- Prawn::Document::Grid
- Prawn::Document::GridBox
- Prawn::Document::Internals
- Prawn::Document::Security
- Prawn::Document::Snapshot
- Prawn::Encoding
- Prawn::Errors
- Prawn::Font
- Prawn::Font::AFM
- Prawn::Font::DFont
- Prawn::Font::TTF
- Prawn::FontMetricCache
- Prawn::Graphics
- Prawn::Graphics::CapStyle
- Prawn::Graphics::Color
- Prawn::Graphics::Dash
- Prawn::Graphics::JoinStyle
- Prawn::Graphics::Patterns
- Prawn::Graphics::Transformation
- Prawn::Graphics::Transparency
- Prawn::ImageHandler
- Prawn::Images
- Prawn::Images::Image
- Prawn::Images::JPG
- Prawn::Images::PNG
- Prawn::Measurements
- Prawn::SoftMask
- Prawn::Stamp
- Prawn::SynchronizedCache
- Prawn::Table
- Prawn::Table::Cell
- Prawn::Table::Cell::Image
- Prawn::Table::Cell::InTable
- Prawn::Table::Cell::SpanDummy
- Prawn::Table::Cell::Subtable
- Prawn::Table::Cell::Text
- Prawn::Table::Cells
- Prawn::Table::ColumnWidthCalculator
- Prawn::Text
- Prawn::Text::Box
- Prawn::Text::Formatted
- Prawn::Text::Formatted::Box
- Prawn::Text::Formatted::Fragment
- Prawn::Text::Formatted::Parser
- Prawn::ThreadLocalCache
- PDF
- PDF::Core
- PDF::Core::Reference
- PDF::Core::Stream
- Arcfour
- Numeric

No matching classes.

# Prawn::Graphics::Patterns

### Public Instance Methods

fill_gradient(*args) click to toggle source

Sets the fill gradient from color1 to color2. old arguments: point, width, height, color1, color2, options = {} new arguments: from, to, color1, color1

    or  from, r1, to, r2, color1, color2

    # File lib/prawn/graphics/patterns.rb, line 18
    def fill_gradient(*args)
      if args[1].is_a?(Array) || args[2].is_a?(Array)
        set_gradient(:fill, *args)
      else
        warn "[DEPRECATION] 'fill_gradient(point, width, height,...)' is deprecated in favor of 'fill_gradient(from, to,...)'. " +
             "Old arguments will be removed in release 1.1"
        set_gradient :fill, args[0], [args[0].first, args[0].last - args[2]], args[3], args[4]
      end
    end

stroke_gradient(*args) click to toggle source

Sets the stroke gradient from color1 to color2. old arguments: point, width, height, color1, color2, options = {} new arguments: from, to, color1, color2

    or  from, r1, to, r2, color1, color2

    # File lib/prawn/graphics/patterns.rb, line 32
    def stroke_gradient(*args)
      if args[1].is_a?(Array) || args[2].is_a?(Array)
        set_gradient(:stroke, *args)
      else
        warn "[DEPRECATION] 'stroke_gradient(point, width, height,...)' is deprecated in favor of 'stroke_gradient(from, to,...)'. " +
             "Old arguments will be removed in release 1.1"
        set_gradient :stroke, args[0], [args[0].first, args[0].last - args[2]], args[3], args[4]
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.