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.10.0 lib/squib/graphics/gradient_regex.rb