forked from rentzsch/clicktoflash
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made the gradient on 10.4 as nice looking as the gradient on 10.5
- Loading branch information
Kevin Hiscott
authored and
Kevin Hiscott
committed
May 28, 2009
1 parent
842dd35
commit 804a099
Showing
4 changed files
with
1,374 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// CTGradient.h | ||
// | ||
// Created by Chad Weider on 2/14/07. | ||
// Writtin by Chad Weider. | ||
// | ||
// Released into public domain on 4/10/08. | ||
// | ||
// Version: 1.8 | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
typedef struct _CTGradientElement | ||
{ | ||
float red, green, blue, alpha; | ||
float position; | ||
|
||
struct _CTGradientElement *nextElement; | ||
} CTGradientElement; | ||
|
||
typedef enum _CTBlendingMode | ||
{ | ||
CTLinearBlendingMode, | ||
CTChromaticBlendingMode, | ||
CTInverseChromaticBlendingMode | ||
} CTGradientBlendingMode; | ||
|
||
|
||
@interface CTGradient : NSObject <NSCopying, NSCoding> | ||
{ | ||
CTGradientElement* elementList; | ||
CTGradientBlendingMode blendingMode; | ||
|
||
CGFunctionRef gradientFunction; | ||
} | ||
|
||
+ (id)gradientWithBeginningColor:(NSColor *)begin endingColor:(NSColor *)end; | ||
|
||
+ (id)aquaSelectedGradient; | ||
+ (id)aquaNormalGradient; | ||
+ (id)aquaPressedGradient; | ||
|
||
+ (id)unifiedSelectedGradient; | ||
+ (id)unifiedNormalGradient; | ||
+ (id)unifiedPressedGradient; | ||
+ (id)unifiedDarkGradient; | ||
|
||
+ (id)sourceListSelectedGradient; | ||
+ (id)sourceListUnselectedGradient; | ||
|
||
+ (id)rainbowGradient; | ||
+ (id)hydrogenSpectrumGradient; | ||
|
||
- (CTGradient *)gradientWithAlphaComponent:(float)alpha; | ||
|
||
- (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position; //positions given relative to [0,1] | ||
- (CTGradient *)removeColorStopAtIndex:(unsigned)index; | ||
- (CTGradient *)removeColorStopAtPosition:(float)position; | ||
|
||
- (CTGradientBlendingMode)blendingMode; | ||
- (NSColor *)colorStopAtIndex:(unsigned)index; | ||
- (NSColor *)colorAtPosition:(float)position; | ||
|
||
|
||
- (void)drawSwatchInRect:(NSRect)rect; | ||
- (void)fillRect:(NSRect)rect angle:(float)angle; //fills rect with axial gradient | ||
// angle in degrees | ||
- (void)radialFillRect:(NSRect)rect; //fills rect with radial gradient | ||
// gradient from center outwards | ||
- (void)fillBezierPath:(NSBezierPath *)path angle:(float)angle; | ||
- (void)radialFillBezierPath:(NSBezierPath *)path; | ||
|
||
@end |
Oops, something went wrong.