svg_profiler 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/svg_profiler/histogram.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d14d28e4b6dfb85ca74c0830690346e42c5d0d59
|
4
|
+
data.tar.gz: ddc47dcfeaec26771a2e1a94980ddcfb01bef60e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 571244e824d4583ba6e0265528b6b502b13976eb6db75985cb961aa58bf2cf37a16f09b676c486c7ec29ad22d87fbcf8bc5e02f0798796629a76bc72fbbe19c3
|
7
|
+
data.tar.gz: 81e04e5bef20e769809fc9cc9ac215317fcfa7d6d8025c131da690f03e3c26565f0aa8be54a86730dcc5cd94712fd9ce1f4812575d4c7941ad8affcde83113b4
|
@@ -47,7 +47,7 @@ class SVGProfiler::Histogram
|
|
47
47
|
pre_filter = normalize(hash)
|
48
48
|
|
49
49
|
hash.reject! do |k, v|
|
50
|
-
|
50
|
+
unless hex_codes.include?(k.downcase) || black?(k)
|
51
51
|
warn_if_filtering_a_prominent_color(k, pre_filter)
|
52
52
|
true
|
53
53
|
end
|
@@ -62,6 +62,12 @@ class SVGProfiler::Histogram
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
# In cases where nodes do not explicitly set a color, they will be black.
|
66
|
+
# Therefore, do not filter out black from the histogram.
|
67
|
+
def black?(hex)
|
68
|
+
hex == "#000000"
|
69
|
+
end
|
70
|
+
|
65
71
|
def normalize(frequencies)
|
66
72
|
sum = frequencies.values.inject(:+)
|
67
73
|
frequencies.inject({}) do |hash, (k, v)|
|