diff --git a/is_dark.gemspec b/is_dark.gemspec index 86454cf..3f7f78e 100644 --- a/is_dark.gemspec +++ b/is_dark.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'is_dark' - s.version = '0.2.0' + s.version = '0.2.1' s.summary = 'Detects a dark background under an area or by a color code' s.description = 'Detects a dark color based on luminance W3 standarts ' \ "( https://www.w3.org/TR/WCAG20/#relativeluminancedef ). \n\n " \ diff --git a/lib/is_dark.rb b/lib/is_dark.rb index d701963..137d8ea 100644 --- a/lib/is_dark.rb +++ b/lib/is_dark.rb @@ -83,7 +83,7 @@ def magick_area_from_blob(x, y, blob, height, width) dots = [] @matrix.each do |xx| @matrix.each do |yy| - dots << { x: (x + (width * xx / 10)).to_i, y: (y + (height * yy / 10)).to_i } + dots << { x: (x + (width * xx / @matrix.count)).to_i, y: (y + (height * yy / @matrix.count)).to_i } end end