isd-color-palette 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/isd-color-palette/controller/isd_color_palette_view_controller.rb +2 -2
- data/lib/isd-color-palette/model/uicolor_isd_extention.rb +2 -0
- data/lib/isd-color-palette/view/isd_rgba_slider_view.rb +15 -3
- data/lib/resources/ISDColorPalette.storyboard +55 -52
- data/lib/resources/ISDColorPalette.storyboardc/DDB-9Z-aLd-view-cjl-ZX-JRH.nib +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/ISDColorPaletteViewController.nib +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/Info.plist +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/Ojg-L0-U3y-view-RZ8-kV-96R.nib +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/UIViewController-DDB-9Z-aLd.nib +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/UIViewController-Ojg-L0-U3y.nib +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/UIViewController-Yhi-Ks-PNF.nib +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/UIViewController-lfU-qe-W46.nib +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/Yhi-Ks-PNF-view-DbN-fh-FRU.nib +0 -0
- data/lib/resources/ISDColorPalette.storyboardc/ccp-rq-upX-view-Gjb-sR-XRJ.nib +0 -0
- metadata +3 -3
data/README.md
CHANGED
@@ -111,7 +111,7 @@ class ISDColorPaletteViewController < UIViewController
|
|
111
111
|
def didChangeColor color
|
112
112
|
self.selectedColor = color
|
113
113
|
if self.selected_color_block
|
114
|
-
color = nil if self.return_nil && color ==
|
114
|
+
color = nil if self.return_nil && color.alpha == 0
|
115
115
|
self.selected_color_block.call color
|
116
116
|
end
|
117
117
|
end
|
@@ -129,7 +129,7 @@ class ISDColorPaletteViewController < UIViewController
|
|
129
129
|
self.solid_layer.backgroundColor = color.uicolor(1).cgcolor
|
130
130
|
self.solid_layer.removeAllAnimations
|
131
131
|
|
132
|
-
colorNameLabel.text = color
|
132
|
+
colorNameLabel.text = color.color_name._
|
133
133
|
colorNameLabel.textColor = color.monochrome.red >= 0.5 ? :black.uicolor : :white.uicolor
|
134
134
|
end
|
135
135
|
|
@@ -26,19 +26,31 @@ class ISDRgbaSliderView < UIView
|
|
26
26
|
=end
|
27
27
|
|
28
28
|
def awakeFromNib
|
29
|
+
|
29
30
|
l = self.layer
|
30
31
|
l.borderColor = :white.uicolor.cgcolor
|
31
32
|
l.borderWidth = 3
|
32
33
|
l.cornerRadius = 4
|
33
|
-
|
34
|
+
|
35
|
+
# setup slider
|
36
|
+
|
34
37
|
@slider = UISlider.new
|
38
|
+
@slider.frame = CGRectInset sliderBaseView.bounds, 0, 8
|
35
39
|
rad = -90 * Math::PI / 180
|
36
40
|
@slider.transform = CGAffineTransformMakeRotation(rad)
|
37
|
-
|
41
|
+
sliderBaseView << @slider
|
42
|
+
|
38
43
|
@slider.addTarget self, action:"didChangeValue:", forControlEvents:UIControlEventValueChanged
|
39
44
|
|
40
|
-
sliderBaseView << @slider
|
41
45
|
end
|
46
|
+
|
47
|
+
def layoutSubviews
|
48
|
+
super
|
49
|
+
return unless self.slider
|
50
|
+
|
51
|
+
self.slider.frame = CGRectInset self.sliderBaseView.bounds, 0, 8
|
52
|
+
end
|
53
|
+
|
42
54
|
|
43
55
|
def color= color
|
44
56
|
@color = color
|
@@ -250,17 +250,18 @@
|
|
250
250
|
</view>
|
251
251
|
</subviews>
|
252
252
|
<constraints>
|
253
|
-
<constraint
|
254
|
-
<constraint firstAttribute="trailing" secondItem="
|
255
|
-
<constraint firstItem="
|
256
|
-
<constraint firstItem="
|
257
|
-
<constraint firstAttribute="bottom" secondItem="GyG-Pq-fWB" secondAttribute="bottom" id="
|
258
|
-
<constraint firstItem="
|
259
|
-
<constraint firstItem="
|
260
|
-
<constraint firstItem="
|
261
|
-
<constraint firstItem="
|
253
|
+
<constraint firstAttribute="trailing" secondItem="GyG-Pq-fWB" secondAttribute="trailing" id="BvJ-3j-4LZ"/>
|
254
|
+
<constraint firstItem="gon-EP-ZNQ" firstAttribute="trailing" secondItem="GyG-Pq-fWB" secondAttribute="trailing" id="J95-RI-W4i"/>
|
255
|
+
<constraint firstItem="GyG-Pq-fWB" firstAttribute="leading" secondItem="bhT-mh-qOp" secondAttribute="leading" id="JxX-ml-dUk"/>
|
256
|
+
<constraint firstItem="gon-EP-ZNQ" firstAttribute="leading" secondItem="GyG-Pq-fWB" secondAttribute="leading" id="Oi6-HF-aZk"/>
|
257
|
+
<constraint firstAttribute="bottom" secondItem="GyG-Pq-fWB" secondAttribute="bottom" id="SaR-Y1-9k8"/>
|
258
|
+
<constraint firstItem="gon-EP-ZNQ" firstAttribute="top" secondItem="1X6-Fn-GXc" secondAttribute="bottom" constant="4" id="Uzp-fN-KGK"/>
|
259
|
+
<constraint firstItem="1X6-Fn-GXc" firstAttribute="centerX" secondItem="gon-EP-ZNQ" secondAttribute="centerX" id="bfw-Hh-Afs"/>
|
260
|
+
<constraint firstItem="GyG-Pq-fWB" firstAttribute="top" secondItem="1X6-Fn-GXc" secondAttribute="bottom" constant="33" id="eIV-z7-2Yk"/>
|
261
|
+
<constraint firstItem="1X6-Fn-GXc" firstAttribute="top" secondItem="bhT-mh-qOp" secondAttribute="top" constant="4" id="tM9-bf-5vN"/>
|
262
262
|
</constraints>
|
263
263
|
<connections>
|
264
|
+
<outlet property="idLabel" destination="1X6-Fn-GXc" id="S1c-96-Rel"/>
|
264
265
|
<outlet property="sliderBaseView" destination="GyG-Pq-fWB" id="pyB-gZ-bqi"/>
|
265
266
|
<outlet property="valueTextField" destination="gon-EP-ZNQ" id="fEV-vA-2aZ"/>
|
266
267
|
<outlet property="viewController" destination="Yhi-Ks-PNF" id="90O-gx-RuZ"/>
|
@@ -292,17 +293,18 @@
|
|
292
293
|
</view>
|
293
294
|
</subviews>
|
294
295
|
<constraints>
|
295
|
-
<constraint firstItem="
|
296
|
-
<constraint firstItem="
|
297
|
-
<constraint firstItem="
|
298
|
-
<constraint firstItem="
|
299
|
-
<constraint
|
300
|
-
<constraint firstAttribute="
|
301
|
-
<constraint
|
302
|
-
<constraint firstAttribute="
|
303
|
-
<constraint firstItem="
|
296
|
+
<constraint firstItem="6y3-Pm-VQ8" firstAttribute="top" secondItem="DRT-5I-XgG" secondAttribute="bottom" constant="33" id="6Nv-6M-T6i"/>
|
297
|
+
<constraint firstItem="6y3-Pm-VQ8" firstAttribute="leading" secondItem="YVg-78-fdF" secondAttribute="leading" id="81A-Gh-qfD"/>
|
298
|
+
<constraint firstItem="HXL-Gb-ssS" firstAttribute="trailing" secondItem="6y3-Pm-VQ8" secondAttribute="trailing" id="Mdc-PS-KTv"/>
|
299
|
+
<constraint firstItem="DRT-5I-XgG" firstAttribute="top" secondItem="YVg-78-fdF" secondAttribute="top" constant="4" id="ePA-WJ-DLR"/>
|
300
|
+
<constraint firstAttribute="bottom" secondItem="6y3-Pm-VQ8" secondAttribute="bottom" id="hrc-G9-vf8"/>
|
301
|
+
<constraint firstItem="HXL-Gb-ssS" firstAttribute="top" secondItem="DRT-5I-XgG" secondAttribute="bottom" constant="4" id="iTF-0C-ZvR"/>
|
302
|
+
<constraint firstAttribute="trailing" secondItem="6y3-Pm-VQ8" secondAttribute="trailing" id="kyc-Iz-NRg"/>
|
303
|
+
<constraint firstItem="HXL-Gb-ssS" firstAttribute="centerX" secondItem="DRT-5I-XgG" secondAttribute="centerX" id="vXs-mT-xfN"/>
|
304
|
+
<constraint firstItem="HXL-Gb-ssS" firstAttribute="leading" secondItem="6y3-Pm-VQ8" secondAttribute="leading" id="xiX-02-Kvp"/>
|
304
305
|
</constraints>
|
305
306
|
<connections>
|
307
|
+
<outlet property="idLabel" destination="DRT-5I-XgG" id="NT5-FP-OG6"/>
|
306
308
|
<outlet property="sliderBaseView" destination="6y3-Pm-VQ8" id="hjv-3t-lv2"/>
|
307
309
|
<outlet property="valueTextField" destination="HXL-Gb-ssS" id="7lx-Tb-0qm"/>
|
308
310
|
<outlet property="viewController" destination="Yhi-Ks-PNF" id="64N-SO-Nt6"/>
|
@@ -334,15 +336,15 @@
|
|
334
336
|
</view>
|
335
337
|
</subviews>
|
336
338
|
<constraints>
|
337
|
-
<constraint firstAttribute="
|
338
|
-
<constraint firstItem="
|
339
|
-
<constraint firstItem="
|
340
|
-
<constraint
|
341
|
-
<constraint firstItem="
|
342
|
-
<constraint firstAttribute="
|
343
|
-
<constraint firstItem="
|
344
|
-
<constraint firstItem="OV8-zN-eBC" firstAttribute="
|
345
|
-
<constraint firstItem="
|
339
|
+
<constraint firstItem="OV8-zN-eBC" firstAttribute="leading" secondItem="GYK-Ya-tqt" secondAttribute="leading" id="3o7-8a-7RS"/>
|
340
|
+
<constraint firstItem="GYK-Ya-tqt" firstAttribute="top" secondItem="GVX-lW-HfY" secondAttribute="bottom" constant="33" id="CCx-JR-u6A"/>
|
341
|
+
<constraint firstItem="GVX-lW-HfY" firstAttribute="centerX" secondItem="OV8-zN-eBC" secondAttribute="centerX" id="SIl-0t-M8I"/>
|
342
|
+
<constraint firstAttribute="bottom" secondItem="GYK-Ya-tqt" secondAttribute="bottom" id="W0e-e4-ufT"/>
|
343
|
+
<constraint firstItem="GVX-lW-HfY" firstAttribute="top" secondItem="crf-eG-EzA" secondAttribute="top" constant="4" id="Yid-Ex-OUh"/>
|
344
|
+
<constraint firstAttribute="trailing" secondItem="GYK-Ya-tqt" secondAttribute="trailing" id="bAy-VR-oPA"/>
|
345
|
+
<constraint firstItem="OV8-zN-eBC" firstAttribute="top" secondItem="GVX-lW-HfY" secondAttribute="bottom" constant="4" id="gmF-IM-sHE"/>
|
346
|
+
<constraint firstItem="OV8-zN-eBC" firstAttribute="trailing" secondItem="GYK-Ya-tqt" secondAttribute="trailing" id="s61-vN-x8W"/>
|
347
|
+
<constraint firstItem="GYK-Ya-tqt" firstAttribute="leading" secondItem="crf-eG-EzA" secondAttribute="leading" id="voM-RN-JoG"/>
|
346
348
|
</constraints>
|
347
349
|
<connections>
|
348
350
|
<outlet property="idLabel" destination="GVX-lW-HfY" id="2ow-P4-Zzw"/>
|
@@ -377,17 +379,18 @@
|
|
377
379
|
</view>
|
378
380
|
</subviews>
|
379
381
|
<constraints>
|
380
|
-
<constraint
|
381
|
-
<constraint firstItem="
|
382
|
-
<constraint firstAttribute="
|
383
|
-
<constraint firstItem="alY-XU-nZq" firstAttribute="top" secondItem="gjh-kq-Dj0" secondAttribute="bottom" constant="4" id="
|
384
|
-
<constraint firstItem="
|
385
|
-
<constraint firstItem="
|
386
|
-
<constraint firstAttribute="
|
387
|
-
<constraint firstItem="alY-XU-nZq" firstAttribute="leading" secondItem="
|
388
|
-
<constraint firstItem="
|
382
|
+
<constraint firstAttribute="trailing" secondItem="2if-yi-hbe" secondAttribute="trailing" id="0bj-JV-yxU"/>
|
383
|
+
<constraint firstItem="gjh-kq-Dj0" firstAttribute="centerX" secondItem="alY-XU-nZq" secondAttribute="centerX" id="4CN-Fo-5sC"/>
|
384
|
+
<constraint firstAttribute="bottom" secondItem="2if-yi-hbe" secondAttribute="bottom" id="AwH-Y9-mYh"/>
|
385
|
+
<constraint firstItem="alY-XU-nZq" firstAttribute="top" secondItem="gjh-kq-Dj0" secondAttribute="bottom" constant="4" id="D1V-Uv-WKW"/>
|
386
|
+
<constraint firstItem="2if-yi-hbe" firstAttribute="top" secondItem="gjh-kq-Dj0" secondAttribute="bottom" constant="33" id="FWb-Vb-4zt"/>
|
387
|
+
<constraint firstItem="2if-yi-hbe" firstAttribute="leading" secondItem="XJe-fJ-Lbo" secondAttribute="leading" id="H2S-31-L6U"/>
|
388
|
+
<constraint firstItem="alY-XU-nZq" firstAttribute="trailing" secondItem="2if-yi-hbe" secondAttribute="trailing" id="NNu-0z-1eX"/>
|
389
|
+
<constraint firstItem="alY-XU-nZq" firstAttribute="leading" secondItem="2if-yi-hbe" secondAttribute="leading" id="iVB-cR-jhj"/>
|
390
|
+
<constraint firstItem="gjh-kq-Dj0" firstAttribute="top" secondItem="XJe-fJ-Lbo" secondAttribute="top" constant="4" id="mWq-hC-OFa"/>
|
389
391
|
</constraints>
|
390
392
|
<connections>
|
393
|
+
<outlet property="idLabel" destination="gjh-kq-Dj0" id="wvu-3I-eqF"/>
|
391
394
|
<outlet property="sliderBaseView" destination="2if-yi-hbe" id="TNI-DO-7z7"/>
|
392
395
|
<outlet property="valueTextField" destination="alY-XU-nZq" id="CmE-pk-FYi"/>
|
393
396
|
<outlet property="viewController" destination="Yhi-Ks-PNF" id="5o6-vD-eJv"/>
|
@@ -396,22 +399,22 @@
|
|
396
399
|
</subviews>
|
397
400
|
<color key="backgroundColor" red="0.91372555489999996" green="0.91372555489999996" blue="0.91372555489999996" alpha="1" colorSpace="deviceRGB"/>
|
398
401
|
<constraints>
|
399
|
-
<constraint firstItem="
|
400
|
-
<constraint
|
401
|
-
<constraint firstAttribute="
|
402
|
-
<constraint
|
403
|
-
<constraint firstItem="
|
404
|
-
<constraint firstItem="
|
405
|
-
<constraint firstItem="
|
406
|
-
<constraint
|
407
|
-
<constraint firstItem="YVg-78-fdF" firstAttribute="
|
408
|
-
<constraint firstItem="
|
409
|
-
<constraint
|
410
|
-
<constraint firstItem="
|
411
|
-
<constraint
|
412
|
-
<constraint firstItem="crf-eG-EzA" firstAttribute="
|
413
|
-
<constraint
|
414
|
-
<constraint firstItem="
|
402
|
+
<constraint firstItem="YVg-78-fdF" firstAttribute="top" secondItem="crf-eG-EzA" secondAttribute="top" id="1o0-yS-UzW"/>
|
403
|
+
<constraint firstAttribute="trailing" secondItem="crf-eG-EzA" secondAttribute="trailing" constant="18" id="27D-yB-z26"/>
|
404
|
+
<constraint firstItem="YVg-78-fdF" firstAttribute="bottom" secondItem="XJe-fJ-Lbo" secondAttribute="bottom" id="Ecf-q2-cl6"/>
|
405
|
+
<constraint firstItem="YVg-78-fdF" firstAttribute="bottom" secondItem="crf-eG-EzA" secondAttribute="bottom" id="HL2-ts-bWL"/>
|
406
|
+
<constraint firstItem="bhT-mh-qOp" firstAttribute="leading" secondItem="YVg-78-fdF" secondAttribute="trailing" constant="41" id="IlQ-H5-BQg"/>
|
407
|
+
<constraint firstItem="YVg-78-fdF" firstAttribute="bottom" secondItem="bhT-mh-qOp" secondAttribute="bottom" id="R2P-kb-GgV"/>
|
408
|
+
<constraint firstItem="XJe-fJ-Lbo" firstAttribute="leading" secondItem="bhT-mh-qOp" secondAttribute="trailing" constant="44" id="aX8-5W-i7u"/>
|
409
|
+
<constraint firstAttribute="trailing" secondItem="bhT-mh-qOp" secondAttribute="trailing" constant="179" id="aym-yX-RmK"/>
|
410
|
+
<constraint firstItem="YVg-78-fdF" firstAttribute="top" secondItem="DbN-fh-FRU" secondAttribute="top" constant="20" symbolic="YES" id="fvD-v8-pol"/>
|
411
|
+
<constraint firstItem="YVg-78-fdF" firstAttribute="leading" secondItem="DbN-fh-FRU" secondAttribute="leading" constant="20" symbolic="YES" id="gh4-qi-yQ4"/>
|
412
|
+
<constraint firstAttribute="bottom" secondItem="YVg-78-fdF" secondAttribute="bottom" constant="20" symbolic="YES" id="hTR-21-I9S"/>
|
413
|
+
<constraint firstItem="YVg-78-fdF" firstAttribute="top" secondItem="bhT-mh-qOp" secondAttribute="top" id="lZd-Qf-uDf"/>
|
414
|
+
<constraint firstAttribute="trailing" secondItem="XJe-fJ-Lbo" secondAttribute="trailing" constant="95" id="s9G-Yh-aLv"/>
|
415
|
+
<constraint firstItem="crf-eG-EzA" firstAttribute="leading" secondItem="XJe-fJ-Lbo" secondAttribute="trailing" constant="37" id="tCO-Cl-9lk"/>
|
416
|
+
<constraint firstAttribute="trailing" secondItem="YVg-78-fdF" secondAttribute="trailing" constant="260" id="vVR-nE-FOZ"/>
|
417
|
+
<constraint firstItem="YVg-78-fdF" firstAttribute="top" secondItem="XJe-fJ-Lbo" secondAttribute="top" id="xIu-VL-cbu"/>
|
415
418
|
</constraints>
|
416
419
|
</view>
|
417
420
|
<toolbarItems/>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isd-color-palette
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-01-
|
12
|
+
date: 2014-01-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -71,7 +71,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
71
|
version: '0'
|
72
72
|
segments:
|
73
73
|
- 0
|
74
|
-
hash: -
|
74
|
+
hash: -413852194933584370
|
75
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
76
|
none: false
|
77
77
|
requirements:
|