forked from kgn/KGNoise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KGNoise.h
69 lines (56 loc) · 1.64 KB
/
KGNoise.h
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
//
// KGNoise.h
// KGNoise
//
// Created by David Keegan on 9/11/12.
// Copyright (c) 2012 David Keegan. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#pragma mark - KGNoise
@interface KGNoise : NSObject
+ (void)drawNoiseWithOpacity:(CGFloat)opacity;
+ (void)drawNoiseWithOpacity:(CGFloat)opacity andBlendMode:(CGBlendMode)blendMode;
@end
#pragma mark - KGNoise Color
#if TARGET_OS_IPHONE
@interface UIColor(KGNoise)
- (UIColor *)colorWithNoiseWithOpacity:(CGFloat)opacity;
- (UIColor *)colorWithNoiseWithOpacity:(CGFloat)opacity andBlendMode:(CGBlendMode)blendMode;
@end
#else
@interface NSColor(KGNoise)
- (NSColor *)colorWithNoiseWithOpacity:(CGFloat)opacity;
- (NSColor *)colorWithNoiseWithOpacity:(CGFloat)opacity andBlendMode:(CGBlendMode)blendMode;
@end
#endif
#pragma mark - KGNoiseView
#if TARGET_OS_IPHONE
@interface KGNoiseView : UIView
#else
@interface KGNoiseView : NSView
@property (strong, nonatomic) NSColor *backgroundColor;
#endif
@property (nonatomic) CGFloat noiseOpacity;
@property (nonatomic) CGBlendMode noiseBlendMode;
@end
#pragma mark - KGNoiseLinearGradientView
@interface KGNoiseLinearGradientView : KGNoiseView
#if TARGET_OS_IPHONE
@property (strong, nonatomic) UIColor *alternateBackgroundColor;
#else
@property (strong, nonatomic) NSColor *alternateBackgroundColor;
#endif
@end
#pragma mark - KGNoiseRadialGradientView
@interface KGNoiseRadialGradientView : KGNoiseView
#if TARGET_OS_IPHONE
@property (strong, nonatomic) UIColor *alternateBackgroundColor;
#else
@property (strong, nonatomic) NSColor *alternateBackgroundColor;
#endif
@end