Sha256: 08c5e144c3279b0d212418a6fe3ab00eec048f6e91c85a28c8c899d551afe28b

Contents?: true

Size: 1.44 KB

Versions: 21

Compression:

Stored size: 1.44 KB

Contents

module Squib
  # @api private
  module Graphics
    STOPS = /   # used to capture the stops
      \s*         # leading whitespace is ok
      (\#?[\w]+)  # color
      @           # no spaces here
      (\d+\.?\d*) # offset number
    /x

    LINEAR_GRADIENT = /
      \( \s*      # coordinate 1
         (\d+\.?\d*) \s* # x1 number
         ,\s*            # whitespace after comma is ok
         (\d+\.?\d*) \s* # y1 number
      \)
      \s*        # space between coordinates is ok
      \( \s*      # coordinate 2
         (\d+\.?\d*) \s* # x2 number
         ,\s*            # whitespace after comma is ok
         (\d+\.?\d*) \s* # y2 number
      \)
      (#{STOPS})+ # stops
      \s*         # trailing whitespace is ok
    /x

    RADIAL_GRADIENT = /
      \( \s*      # coordinate 1
        (\d+\.?\d*) \s* # x1 number
        ,\s*            # whitespace after comma is ok
        (\d+\.?\d*) \s* # y1 number
        ,\s*            # whitespace after comma is ok
        (\d+\.?\d*) \s* # r1 number
      \)
      \s*         # space between coordinates is ok
      \( \s*      # coordinate 2
        (\d+\.?\d*) \s* # x2 number
        ,\s*            # whitespace after comma is ok
        (\d+\.?\d*) \s* # y2 number
        ,\s*            # whitespace after comma is ok
        (\d+\.?\d*) \s* # r2 number
      \)
      (#{STOPS})+ # stops
      \s*         # trailing whitespace is ok
    /x
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
squib-0.18.0 lib/squib/graphics/gradient_regex.rb
squib-0.17.2 lib/squib/graphics/gradient_regex.rb
squib-0.17.1 lib/squib/graphics/gradient_regex.rb
squib-0.17.0 lib/squib/graphics/gradient_regex.rb
squib-0.16.0 lib/squib/graphics/gradient_regex.rb
squib-0.16.0.pre.preview2 lib/squib/graphics/gradient_regex.rb
squib-0.16.0.pre.preview1 lib/squib/graphics/gradient_regex.rb
squib-0.15.3 lib/squib/graphics/gradient_regex.rb
squib-0.15.0 lib/squib/graphics/gradient_regex.rb
squib-0.14.3.pre1 lib/squib/graphics/gradient_regex.rb
squib-0.14.1 lib/squib/graphics/gradient_regex.rb
squib-0.14.0 lib/squib/graphics/gradient_regex.rb
squib-0.14.beta1 lib/squib/graphics/gradient_regex.rb
squib-0.13.4 lib/squib/graphics/gradient_regex.rb
squib-0.13.3 lib/squib/graphics/gradient_regex.rb
squib-0.13.2 lib/squib/graphics/gradient_regex.rb
squib-0.13.1 lib/squib/graphics/gradient_regex.rb
squib-0.13.0 lib/squib/graphics/gradient_regex.rb
squib-0.12.0 lib/squib/graphics/gradient_regex.rb
squib-0.11.0 lib/squib/graphics/gradient_regex.rb