-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFluidColorChooser.m
71 lines (54 loc) · 1.54 KB
/
FluidColorChooser.m
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
61
62
63
64
65
66
67
68
69
70
71
//
// FluidColorChooser.m
// FluidApp
//
#import "FluidColorChooser.h"
static FluidColorChooser *si;
@implementation FluidColorChooser
- (void)awakeFromNib
{
si = self;
}
+ (FluidColorChooser*)sharedInstance
{
return si;
}
- (void)setColorRed:(float)in_r green:(float)in_g blue:(float)in_b
{
[ib_red setFloatValue:in_r];
[ib_green setFloatValue:in_g];
[ib_blue setFloatValue:in_b];
[ib_color setColor:[NSColor colorWithCalibratedRed:[ib_red floatValue]
green:[ib_green floatValue]
blue:[ib_blue floatValue]
alpha:1.0f]];
}
- (IBAction)onChangeRed:in_sld
{
[ib_color setColor:[NSColor colorWithCalibratedRed:[ib_red floatValue]
green:[ib_green floatValue]
blue:[ib_blue floatValue]
alpha:1.0f]];
[responder onChangeColorRed:[ib_red floatValue] green:[ib_green floatValue] blue:[ib_blue floatValue]];
}
- (IBAction)onChangeGreen:in_sld
{
[ib_color setColor:[NSColor colorWithCalibratedRed:[ib_red floatValue]
green:[ib_green floatValue]
blue:[ib_blue floatValue]
alpha:1.0f]];
[responder onChangeColorRed:[ib_red floatValue] green:[ib_green floatValue] blue:[ib_blue floatValue]];
}
- (IBAction)onChangeBlue:in_sld
{
[ib_color setColor:[NSColor colorWithCalibratedRed:[ib_red floatValue]
green:[ib_green floatValue]
blue:[ib_blue floatValue]
alpha:1.0f]];
[responder onChangeColorRed:[ib_red floatValue] green:[ib_green floatValue] blue:[ib_blue floatValue]];
}
- (void)setResponder:(id<FluidColorChooserResponder>)in_r
{
responder = in_r;
}
@end