source: orbit/iOS/Orbit/Orbit/CorePlotHeaders/CPTGradient.h @ cef53d8

ServoTab_Interfacepyramid
Last change on this file since cef53d8 was a9059a5, checked in by Steve Castellotti <sc@…>, 10 years ago

Arduino:

  • updated to permit custom setting of Throttle, Yaw, and Pitch

Android:

  • Minor tweak to Configuration location

iOS:

  • Property mode set to 100644
File size: 3.1 KB
Line 
1// Based on CTGradient (http://blog.oofn.net/2006/01/15/gradients-in-cocoa/)
2// CTGradient is in public domain (Thanks Chad Weider!)
3
4/// @file
5
6#import "CPTDefinitions.h"
7#import <Foundation/Foundation.h>
8
9/**
10 *  @brief A structure representing one node in a linked list of RGBA colors.
11 **/
12typedef struct _CPTGradientElement {
13    CPTRGBAColor color; ///< Color
14    CGFloat position;   ///< Gradient position (0 ≀ @par{position} ≀ 1)
15
16    struct _CPTGradientElement *nextElement; ///< Pointer to the next CPTGradientElement in the list (last element == @NULL)
17}
18CPTGradientElement;
19
20/**
21 *  @brief Enumeration of blending modes
22 **/
23typedef enum _CPTBlendingMode {
24    CPTLinearBlendingMode,          ///< Linear blending mode
25    CPTChromaticBlendingMode,       ///< Chromatic blending mode
26    CPTInverseChromaticBlendingMode ///< Inverse chromatic blending mode
27}
28CPTGradientBlendingMode;
29
30/**
31 *  @brief Enumeration of gradient types
32 **/
33typedef enum _CPTGradientType {
34    CPTGradientTypeAxial, ///< Axial gradient
35    CPTGradientTypeRadial ///< Radial gradient
36}
37CPTGradientType;
38
39@class CPTColorSpace;
40@class CPTColor;
41
42@interface CPTGradient : NSObject<NSCopying, NSCoding> {
43    @private
44    CPTColorSpace *colorspace;
45    CPTGradientElement *elementList;
46    CPTGradientBlendingMode blendingMode;
47    CGFunctionRef gradientFunction;
48    CGFloat angle; // angle in degrees
49    CPTGradientType gradientType;
50}
51
52@property (nonatomic, readonly, assign) CPTGradientBlendingMode blendingMode;
53@property (nonatomic, readwrite, assign) CGFloat angle;
54@property (nonatomic, readwrite, assign) CPTGradientType gradientType;
55
56/// @name Factory Methods
57/// @{
58+(CPTGradient *)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColor *)end;
59+(CPTGradient *)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColor *)end beginningPosition:(CGFloat)beginningPosition endingPosition:(CGFloat)endingPosition;
60
61+(CPTGradient *)aquaSelectedGradient;
62+(CPTGradient *)aquaNormalGradient;
63+(CPTGradient *)aquaPressedGradient;
64
65+(CPTGradient *)unifiedSelectedGradient;
66+(CPTGradient *)unifiedNormalGradient;
67+(CPTGradient *)unifiedPressedGradient;
68+(CPTGradient *)unifiedDarkGradient;
69
70+(CPTGradient *)sourceListSelectedGradient;
71+(CPTGradient *)sourceListUnselectedGradient;
72
73+(CPTGradient *)rainbowGradient;
74+(CPTGradient *)hydrogenSpectrumGradient;
75/// @}
76
77/// @name Modification
78/// @{
79-(CPTGradient *)gradientWithAlphaComponent:(CGFloat)alpha;
80-(CPTGradient *)gradientWithBlendingMode:(CPTGradientBlendingMode)mode;
81
82-(CPTGradient *)addColorStop:(CPTColor *)color atPosition:(CGFloat)position; // positions given relative to [0,1]
83-(CPTGradient *)removeColorStopAtIndex:(NSUInteger)idx;
84-(CPTGradient *)removeColorStopAtPosition:(CGFloat)position;
85/// @}
86
87/// @name Information
88/// @{
89-(CGColorRef)newColorStopAtIndex:(NSUInteger)idx;
90-(CGColorRef)newColorAtPosition:(CGFloat)position;
91/// @}
92
93/// @name Drawing
94/// @{
95-(void)drawSwatchInRect:(CGRect)rect inContext:(CGContextRef)context;
96-(void)fillRect:(CGRect)rect inContext:(CGContextRef)context;
97-(void)fillPathInContext:(CGContextRef)context;
98/// @}
99
100@end
Note: See TracBrowser for help on using the repository browser.