forked from InfinitApps/InfColorPicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInfColorPicker.h
More file actions
60 lines (46 loc) · 1.84 KB
/
Copy pathInfColorPicker.h
File metadata and controls
60 lines (46 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//==============================================================================
//
// InfColorPicker.h
// InfColorPicker
//
// Created by Troy Gaul on 7 Aug 2010.
//
// Copyright (c) 2011 InfinitApps LLC - http://infinitapps.com
// Some rights reserved: http://opensource.org/licenses/MIT
//
//==============================================================================
/*
The InfiniApps Color Picker, known as InfColorPicker, is a view controller
for use in iOS applications to allow the selection of a color from RGB space,
but using an HSB representation of that color space to make selection of a
color easier for a human.
InfColorPicker is distributed with an MIT license. It supports iPhone OS 3.x
as well as iOS 4 and 5.
Usage
-----
The main component is the `InfColorPickerController` class, which can be
instantiated and hosted in a few different ways, such as in a popover view
controller for the iPad, pushed onto a navigation controller navigation
stack, or presented modally on an iPhone.
The initial color can be set via the property `sourceColor`, which will be
shown alongside the user-selected `resultColor` color, and these can be
accessed and changed while the color picker is visible.
In order to receive the selected color(s) back from the controller, you have
to have an object that implements one of the methods in the
`InfColorPickerControllerDelegate` protocol.
Example
-------
- (void) changeColor
{
InfColorPickerController* picker = [ InfColorPickerController colorPickerViewController ];
picker.sourceColor = self.color;
picker.delegate = self;
[ picker presentModallyOverViewController: self ];
}
- (void) colorPickerControllerDidFinish: (InfColorPickerController*) picker
{
self.color = picker.resultColor;
[ self dismissModalViewControllerAnimated: YES ];
}
*/
#import "InfColorPickerController.h"