falu 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/falu.rb +1 -0
- data/lib/falu/palette.rb +5 -3
- data/lib/falu/version.rb +1 -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: a4df7374b394281ccf58ca3834914be2341b12e6
|
4
|
+
data.tar.gz: ae16e01cf378501cd2d36bb7092b6abcb798e27c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: feaf26e05189fd0db64511826450a55dbf55f8ad4bc69de20e483e332a3e495d1226bf7ab91fa37c606ccd835b873f379e1111cef3c733b303dacd6c59c86094
|
7
|
+
data.tar.gz: 4191f7a9fbe5650d25e4ef193e79bccbe9b584306b9c5c315a9316c2f7930e24152dd27cb381d0675a861041a42a32ff4178fb0057ba91c0487338423b50fa30
|
data/lib/falu.rb
CHANGED
data/lib/falu/palette.rb
CHANGED
@@ -114,7 +114,7 @@ module Falu
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def primary
|
117
|
-
@primary ||= dominant
|
117
|
+
@primary ||= dominant#(3).sort_by { |swtch| swtch.color.rgb.colors.sum }.first
|
118
118
|
end
|
119
119
|
|
120
120
|
def secondary=(sec)
|
@@ -123,7 +123,9 @@ module Falu
|
|
123
123
|
end
|
124
124
|
|
125
125
|
def secondary
|
126
|
-
@secondary ||=
|
126
|
+
@secondary ||= begin
|
127
|
+
dominant(3).last(2).sort_by { |swtch| (swtch.color.rgb.colors.sum - primary.color.rgb.colors.sum).abs }.last
|
128
|
+
end
|
127
129
|
end
|
128
130
|
|
129
131
|
def accent=(acc)
|
@@ -132,7 +134,7 @@ module Falu
|
|
132
134
|
end
|
133
135
|
|
134
136
|
def accent
|
135
|
-
@accent ||= dominant(3).
|
137
|
+
@accent ||= dominant(3).find { |swtch| ![primary.color.to_s, secondary.color.to_s].include?(swtch.color.to_s) }
|
136
138
|
end
|
137
139
|
|
138
140
|
def as_json(options={})
|
data/lib/falu/version.rb
CHANGED