Repository navigation
Expand file tree
/
Copy pathWDGradient.h
More file actions
57 lines (44 loc) · 1.75 KB
/
Copy pathWDGradient.h
File metadata and controls
57 lines (44 loc) · 1.75 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
//
// WDGradient.h
// Inkpad
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2000-2013 Steve Sprang
//
#import <Foundation/Foundation.h>
#import "WDPathPainter.h"
typedef enum {
kWDLinearGradient,
kWDRadialGradient
} WDGradientType;
@class WDColor;
@class WDGradientStop;
@class WDFillTransform;
@class WDXMLElement;
@interface WDGradient : NSObject <NSCopying, NSCoding, WDPathPainter> {
CGGradientRef gradientRef_; // for rendering
}
@property (nonatomic, readonly) WDGradientType type;
@property (nonatomic, readonly) NSArray *stops;
+ (WDGradient *) randomGradient;
+ (WDGradient *) defaultGradient;
+ (WDGradient *) gradientWithStart:(WDColor *)start andEnd:(WDColor*)end;
+ (WDGradient *) gradientWithType:(WDGradientType)type stops:(NSArray *)stops;
- (id) initWithType:(WDGradientType)type stops:(NSArray *)stops;
- (WDGradient *) gradientByReversing;
- (WDGradient *) gradientByDistributingEvenly;
- (WDGradient *) gradientWithStops:(NSArray *)stops;
- (WDGradient *) gradientWithType:(WDGradientType)type;
- (WDGradient *) gradientWithStop:(WDGradientStop *)stop substitutedForStop:(WDGradientStop *)replace;
- (WDGradient *) gradientByRemovingStop:(WDGradientStop *)stop;
- (WDGradient *) gradientByAddingStop:(WDGradientStop *)stop;
- (WDGradient *) gradientWithStopAtRatio:(float)ratio;
- (WDGradient *) adjustColor:(WDColor * (^)(WDColor *color))adjustment;
- (WDColor *) colorAtRatio:(float)ratio;
- (CGGradientRef) gradientRef;
- (void) drawSwatchInRect:(CGRect)rect;
- (WDXMLElement *) SVGElementWithID:(NSString *)unique fillTransform:(WDFillTransform *)fT;
@end