From d6d458b004664314c5c4826617f8bae57be8c552 Mon Sep 17 00:00:00 2001 From: riky Date: Mon, 27 Mar 2017 16:22:15 +0900 Subject: [PATCH] fixed doesn't parse RGB from srgba eg. #757679FF => nil to #757679FF => #757679 --- lib/colorscore/histogram.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/colorscore/histogram.rb b/lib/colorscore/histogram.rb index 4debcd5..757deeb 100644 --- a/lib/colorscore/histogram.rb +++ b/lib/colorscore/histogram.rb @@ -9,7 +9,7 @@ def initialize(image_path, colors=16, depth=8) # Returns an array of colors in descending order of occurances. def colors - hex_values = @lines.map { |line| line[/#([0-9A-F]{6}) /, 1] }.compact + hex_values = @lines.map { |line| line[/#([0-9A-F]{6})/, 1] }.compact hex_values.map { |hex| Color::RGB.from_html(hex) } end