Commit fac2047c authored by Douwe Maan's avatar Douwe Maan

Use %r around multi-line regular expressions

parent a00aed74
...@@ -7,7 +7,7 @@ module Banzai ...@@ -7,7 +7,7 @@ module Banzai
DEGS = /-?\d+(?:deg)?/i # [-]digits[deg] DEGS = /-?\d+(?:deg)?/i # [-]digits[deg]
RADS = /-?(?:\d+(?:\.\d+)?|\.\d+)rad/i # [-](digits[.digits] OR .digits)rad RADS = /-?(?:\d+(?:\.\d+)?|\.\d+)rad/i # [-](digits[.digits] OR .digits)rad
HEX_FORMAT = /\#(?:\h{3}|\h{4}|\h{6}|\h{8})/ HEX_FORMAT = /\#(?:\h{3}|\h{4}|\h{6}|\h{8})/
RGB_FORMAT = / RGB_FORMAT = %r{
(?:rgba? (?:rgba?
\( \(
(?: (?:
...@@ -18,15 +18,15 @@ module Banzai ...@@ -18,15 +18,15 @@ module Banzai
#{ALPHA_CHANNEL} #{ALPHA_CHANNEL}
\) \)
) )
/xi }xi
HSL_FORMAT = / HSL_FORMAT = %r{
(?:hsla? (?:hsla?
\( \(
(?:#{DEGS}|#{RADS}),\s*#{PERCENTS},\s*#{PERCENTS} (?:#{DEGS}|#{RADS}),\s*#{PERCENTS},\s*#{PERCENTS}
#{ALPHA_CHANNEL} #{ALPHA_CHANNEL}
\) \)
) )
/xi }xi
FORMATS = [HEX_FORMAT, RGB_FORMAT, HSL_FORMAT].freeze FORMATS = [HEX_FORMAT, RGB_FORMAT, HSL_FORMAT].freeze
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment