Sha256: bfb901e60bed62d10211abbbfdd30c0d6feb74c59a47e1d70b7f414cfc8a880d

Contents?: true

Size: 1.43 KB

Versions: 2

Compression:

Stored size: 1.43 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

2 entries across 2 versions & 1 rubygems

Version Path
squib-0.9.0 lib/squib/graphics/gradient_regex.rb
squib-0.6.0 lib/squib/graphics/gradient_regex.rb