source: trunk/Cocoa/AntiRSI/CTBadge/CTGradient.h@ 609

Last change on this file since 609 was 332, checked in by Nicholas Riley, 17 years ago

version.plist: Not needed.

Info.plist: Updated for 1.4njr2.

AUTHORS: Updated Onne Gorter's email address and added mine.

AntiRSI.[hm]: Added dock badge session timer display and auto-reset options. Updated URLs to point to my Web site; should probably just switch to Sparkle.

CTBadge: Added customized version.

English.lproj/InfoPlist.strings: Updated for 1.4njr2; credit myself and Chad; remove Onne Gorter's URL.

English.lproj/MainMenu.nib: Preference changes; add cmd-R for manual reset.

File size: 1.9 KB
Line 
1//
2// CTGradient.h
3//
4// Created by Chad Weider on 2/14/07.
5// Copyright (c) 2007 Chad Weider.
6// Some rights reserved: <http://creativecommons.org/licenses/by/2.5/>
7//
8// Version: 1.6
9
10#import <Cocoa/Cocoa.h>
11
12typedef struct _CTGradientElement
13 {
14 float red, green, blue, alpha;
15 float position;
16
17 struct _CTGradientElement *nextElement;
18 } CTGradientElement;
19
20typedef enum _CTBlendingMode
21 {
22 CTLinearBlendingMode,
23 CTChromaticBlendingMode,
24 CTInverseChromaticBlendingMode
25 } CTGradientBlendingMode;
26
27
28@interface CTGradient : NSObject <NSCopying, NSCoding>
29 {
30 CTGradientElement* elementList;
31 CTGradientBlendingMode blendingMode;
32
33 CGFunctionRef gradientFunction;
34 }
35
36+ (id)gradientWithBeginningColor:(NSColor *)begin endingColor:(NSColor *)end;
37
38+ (id)aquaSelectedGradient;
39+ (id)aquaNormalGradient;
40+ (id)aquaPressedGradient;
41
42+ (id)unifiedSelectedGradient;
43+ (id)unifiedNormalGradient;
44+ (id)unifiedPressedGradient;
45+ (id)unifiedDarkGradient;
46
47+ (id)sourceListSelectedGradient;
48+ (id)sourceListUnselectedGradient;
49
50+ (id)rainbowGradient;
51+ (id)hydrogenSpectrumGradient;
52
53- (CTGradient *)gradientWithAlphaComponent:(float)alpha;
54
55- (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position; //positions given relative to [0,1]
56- (CTGradient *)removeColorStopAtIndex:(unsigned)index;
57- (CTGradient *)removeColorStopAtPosition:(float)position;
58
59- (CTGradientBlendingMode)blendingMode;
60- (NSColor *)colorStopAtIndex:(unsigned)index;
61- (NSColor *)colorAtPosition:(float)position;
62
63
64- (void)drawSwatchInRect:(NSRect)rect;
65- (void)fillRect:(NSRect)rect angle:(float)angle; //fills rect with axial gradient
66 // angle in degrees
67- (void)radialFillRect:(NSRect)rect; //fills rect with radial gradient
68 // gradient from center outwards
69- (void)fillBezierPath:(NSBezierPath *)path angle:(float)angle;
70- (void)radialFillBezierPath:(NSBezierPath *)path;
71
72@end
Note: See TracBrowser for help on using the repository browser.