camalian 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df3efad40b55f5cc45e321d93c23077296b7367de0ea54dfb663b666c6c47b2f
4
- data.tar.gz: d1d99748916c16c4b13e247427ae54a166623893cdfdd9322978fa16d8ab85f4
3
+ metadata.gz: 5b9de2c66339ca8ad016f7008d1737b6015bf0a69c5ebfb420d31f4183a52257
4
+ data.tar.gz: 8280252df27703b1bb26bbbb86ba8af9749c7e9daefb5ed4b6c74db445273777
5
5
  SHA512:
6
- metadata.gz: a3e0d48d911fdd7fe75a5fb5bcb2b7963e509eb7297f924be57ecd806ff36db462d347e2d1159d4d28031c077e5cb39a1e0df1716614e00311fb4f192f694722
7
- data.tar.gz: '08f12c2b89f583d56fc327fe20f6d283a042d0bd435152fe29cec944b1e5ca187b56daa2f4601cdb88da2627fa41c445516c02db819cbe14b2ea408d036a76fa'
6
+ metadata.gz: 6220b18f426c0a30240a98afb98e1217d9aab1947051c9b305a5b7f6d413e71c4a8ef7420ecafed128eab0428fd28f9ee2e844ad30d06fa80fa5a1d2900b9cfa
7
+ data.tar.gz: 8e7d6b392ffda8cf50dfbbdec3bdf75bfd050d7f50618b0236cb1848e6802d0fc8abaed7c522c263f533a9be67108d866679a176f80ca88db6e27e9aa5e063f2
data/README.md CHANGED
@@ -10,7 +10,7 @@ Ruby gem to extract color palettes from images and play with their saturation
10
10
 
11
11
  Add this line to your application's Gemfile:
12
12
 
13
- gem 'camalian', '~> 0.2.1'
13
+ gem 'camalian', '~> 0.2.2'
14
14
 
15
15
  And then execute:
16
16
 
@@ -13,7 +13,10 @@ module Camalian
13
13
  buckets[key].push(color)
14
14
  end
15
15
 
16
- Palette.new(buckets.map { |_, value| value.average_color }[0...count])
16
+ buckets = buckets.values
17
+ buckets = buckets.sort_by(&:size).reverse
18
+ average_colors = buckets.map(&:average_color)
19
+ Palette.new(average_colors[0...count])
17
20
  end
18
21
 
19
22
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Camalian
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camalian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nazar Hussain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-18 00:00:00.000000000 Z
11
+ date: 2021-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chunky_png