Skip to content

A platform for community discussion. Free, open, simple.

FIX: raise new RuntimeError in ColorMath raises NoMethodError (#44039)

Ary Rabeloa419a18db27f
diff --git a/lib/color_math.rb b/lib/color_math.rb
index 074b9cc4da9..b6d3ddf3d31 100644
--- a/lib/color_math.rb
+++ b/lib/color_math.rb
@@ -59,7 +59,7 @@ module ColorMath
def self.hex_to_rgb(color)
color = color.gsub(/(.)/, '\1\1') if color.length == 3
- raise new RuntimeError("Hex color must be 6 characters") if color.length != 6
+ raise "Hex color must be 6 characters" if color.length != 6
color.scan(/../).map { |c| c.to_i(16) }
end