DrawKit
Vector and illustration framework for Mac OS X
|
A DKGradient encapsulates gradient/shading drawing. More...
Instance Methods | |
(DKColorStop *) | - addColor:at: |
(void) | - addColorStop: |
(CGFloat) | - angle |
Returns the gradient's current angle in radians. More... | |
(CGFloat) | - angleInDegrees |
Returns the gradient's current angle in degrees. More... | |
(NSColor *) | - colorAtValue: |
Returns the computed Color for the gradient ramp expressed as a value from 0 to 1.0. More... | |
(NSArray *) | - colorStops |
Returns the list of Color stops in the gradient. More... | |
(void) | - convertOldKey: |
(void) | - convertOldKeys |
(NSUInteger) | - countOfColorStops |
Returns the number of Color stops in the gradient. More... | |
(void) | - fillContext:startingAtPoint:startRadius:endingAtPoint:endRadius: |
(void) | - fillPath: |
Fills the path using the gradient. More... | |
(void) | - fillPath:centreOffset: |
Fills the path using the gradient. More... | |
(void) | - fillPath:startingAtPoint:startRadius:endingAtPoint:endRadius: |
(void) | - fillRect: |
(DKGradientBlending) | - gradientBlending |
(DKGradient *) | - gradientByColorizingWithColor: |
Creates a copy of the gradient but colorizies it by substituting the hue from <color> More... | |
(DKGradientInterpolation) | - gradientInterpolation |
Returns the interpolation algorithm for the gradient. More... | |
(DKGradientType) | - gradientType |
(DKGradient *) | - gradientWithAlpha: |
Creates a copy of the gradient but sets the alpha vealue of all stop colours to <alpha> More... | |
(BOOL) | - hasRadialSettings |
(void) | - insertObject:inColorStopsAtIndex: |
(NSPoint) | - mapPoint:fromRect: |
(NSPoint) | - mapPoint:toRect: |
(DKColorStop *) | - objectInColorStopsAtIndex: |
Returns the the indexed Color stop. More... | |
(NSPoint) | - radialEndingPoint |
(CGFloat) | - radialEndingRadius |
(NSPoint) | - radialStartingPoint |
(CGFloat) | - radialStartingRadius |
(void) | - removeAllColors |
Removes all Colors from the list of Colors. More... | |
(void) | - removeColorStop: |
Removes a Color stop from the list of Colors. More... | |
(void) | - removeLastColor |
Removes the last Color from he list of Colors. More... | |
(void) | - removeObjectFromColorStopsAtIndex: |
(void) | - reverseColorStops |
Reverses the order of all the Color stops so "inverting" the gradient. More... | |
(void) | - setAngle: |
Sets the gradient's current angle in radians. More... | |
(void) | - setAngleInDegrees: |
Sets the angle of the gradient to the given angle. More... | |
(void) | - setAngleWithoutNotifying: |
(void) | - setColorStops: |
Sets the list of Color stops in the gradient. More... | |
(void) | - setGradientBlending: |
(void) | - setGradientInterpolation: |
(void) | - setGradientType: |
Sets the gradient's basic type. More... | |
(void) | - setRadialEndingPoint: |
(void) | - setRadialEndingRadius: |
(void) | - setRadialStartingPoint: |
(void) | - setRadialStartingRadius: |
(void) | - setUpExtensionData |
(void) | - sortColorStops |
Sorts the Color stops into position order. More... | |
(NSImage *) | - standardSwatchImage |
(NSImage *) | - swatchImageWithSize:withBorder: |
Returns an image of the current gradient for use in a UI, etc. More... | |
Instance Methods inherited from GCObservableObject | |
(NSString *) | - actionNameForKeyPath: |
(NSString *) | - actionNameForKeyPath:changeKind: |
(NSArray *) | - oldArrayValueForKeyPath: |
(void) | - registerActionNames |
(void) | - sendInitialValuesForAllPropertiesToObserver:context: |
(void) | - setActionName:forKeyPath: |
(BOOL) | - setUpKVOForObserver: |
(void) | - setUpObservables:forObserver: |
(BOOL) | - tearDownKVOForObserver: |
(void) | - tearDownObservables:forObserver: |
Instance Methods inherited from NSObject | |
(NSString *) | - address |
(DKStyleRegistry *) | - applicationWillReturnStyleRegistry |
(BOOL) | - canBeUsedWithSelectionTool |
(id) | - categoryManager:shouldReplaceObject:withObject: |
(Class) | - classForCoder |
(NSColor *) | - colorValue |
(NSColor *) | - colourValue |
(id) | - copy |
(void) | - dealloc |
(id) | - deepCopy |
(NSDictionary *) | - dimensionValuesForArrowStroke: |
(CGFloat) | - drawing:convertDistanceToExternalCoordinates: |
(NSPoint) | - drawing:convertLocationToExternalCoordinates: |
(void) | - drawing:didDrawRect:inView: |
(void) | - drawing:willDrawRect:inView: |
(NSString *) | - drawing:willReturnAbbreviationForUnit: |
(NSString *) | - drawing:willReturnFormattedCoordinateForDistance: |
(CGFloat) | - drawingWillReturnUnitToPointsConversonFactor: |
(void) | - finalize |
(NSString *) | - hexString |
(void) | - hotspot:didEndTrackingWithEvent:inView: |
(void) | - hotspot:isTrackingWithEvent:inView: |
(void) | - hotspot:willBeginTrackingWithEvent:inView: |
(NSData *) | - imageData |
(NSImage *) | - imageResourceNamed: |
(id) | - init |
(id) | - initWithExpression: |
(id) | - instantiateObjectWithShortName:parameters: |
(BOOL) | - isLiteralValue |
(void) | - layoutManager:willPlaceGlyphAtIndex:atLocation:pathAngle:yOffset: |
(void) | - menuItem:wasAddedForObject:inCategory: |
(BOOL) | - moveObjectTo:position:slope:userInfo: |
(id) | - mutableCopy |
(void) | - oneShotComplete |
(void) | - oneShotHasReached: |
(void) | - oneShotWillBegin |
(void) | - path:elementIndex:type:points:subPathIndex:subPathClosed:contextInfo: |
(id) | - placeLinkFromPoint:toPoint:onPath:linkNumber:userInfo: |
(id) | - placeObjectAtPoint:onPath:position:slope:userInfo: |
(NSPoint) | - point |
(NSPoint) | - pointForTextLayout |
(DKStyle *) | - registry:shouldReplaceStyle:withStyle: |
(NSBezierPath *) | - renderer:willRenderPath: |
(void) | - routeFinder:progressHasReached: |
(void) | - setValue:forNumericParameter: |
(NSString *) | - stringValue |
(CGFloat) | - taperFactorAtDistance:onPath:ofLength: |
(void) | - toolDidPerformUndoableAction: |
(void) | - toolWillPerformUndoableAction: |
(NSURL *) | - url |
Instance Methods inherited from <NSObject> | |
(NSString *) | - description |
(NSUInteger) | - hash |
(BOOL) | - isEqual: |
Instance Methods inherited from <NSKeyValueBindingCreation> | |
(void) | - bind:toObject:withKeyPath:options: |
(NSArray *) | - exposedBindings |
(NSDictionary *) | - infoForBinding: |
(NSArray *) | - optionDescriptionsForBinding: |
(void) | - unbind: |
(Class) | - valueClassForBinding: |
Instance Methods inherited from <NSCoding> | |
(void) | - encodeWithCoder: |
(id) | - initWithCoder: |
Instance Methods inherited from <NSCopying> | |
(id) | - copyWithZone: |
Protected Attributes | |
DKGradientBlending | m_blending |
CGFunctionRef | m_cbfunc |
NSMutableArray * | m_colorStops |
id | m_extensionData |
CGFloat | m_gradAngle |
DKGradientType | m_gradType |
DKGradientInterpolation | m_interp |
A DKGradient encapsulates gradient/shading drawing.
- (DKColorStop*) addColor: | (NSColor *) | Color | |
at: | (CGFloat) | pos | |
- (void) addColorStop: | (DKColorStop *) | stop |
- (CGFloat) angle |
Returns the gradient's current angle in radians.
- (CGFloat) angleInDegrees |
Returns the gradient's current angle in degrees.
+ (DKGradient*) aquaNormalGradient |
Provided by category DKGradient(UISupport).
+ (DKGradient*) aquaPressedGradient |
Provided by category DKGradient(UISupport).
+ (DKGradient*) aquaSelectedGradient |
Provided by category DKGradient(UISupport).
Returns the computed Color for the gradient ramp expressed as a value from 0 to 1.0.
While intended for internal use, this function can be called at any time if you wish the private version here is called internally. It does fewer checks and returns raw component values for performance. do not use from external code.
val | the proportion of the gradient ramp from start (0) to finish (1.0) |
- (NSArray*) colorStops |
Returns the list of Color stops in the gradient.
A gradient needs a minimum of two Colors to be a gradient, but will function with one.
- (void) convertOldKey: | (NSString *) | key |
Provided by category DKGradient(DKGradientExtensions).
- (void) convertOldKeys |
Provided by category DKGradient(DKGradientExtensions).
- (NSUInteger) countOfColorStops |
Returns the number of Color stops in the gradient.
This also makes the stops array KVC compliant
+ (DKGradient*) defaultGradient |
Returns an instance of the default gradient (simple linear black to white)
Provided by category DKGradient(UISupport).
- (void) fillContext: | (CGContextRef) | context | |
startingAtPoint: | (NSPoint) | sp | |
startRadius: | (CGFloat) | sr | |
endingAtPoint: | (NSPoint) | ep | |
endRadius: | (CGFloat) | er | |
- (void) fillPath: | (NSBezierPath *) | path |
Fills the path using the gradient.
The fill will proceed as for a standard fill. A gradient that needs a starting point will assume the centre of the path's bounds as that point when using this method.
path | the bezier path to fill. |
- (void) fillPath: | (NSBezierPath *) | path | |
centreOffset: | (NSPoint) | co | |
Fills the path using the gradient.
path | the bezier path to fill |
co | displacement from the centre for the start of a radial fill |
- (void) fillPath: | (NSBezierPath *) | path | |
startingAtPoint: | (NSPoint) | sp | |
startRadius: | (CGFloat) | sr | |
endingAtPoint: | (NSPoint) | ep | |
endRadius: | (CGFloat) | er | |
- (void) fillRect: | (NSRect) | rect |
- (DKGradientBlending) gradientBlending |
- (DKGradient*) gradientByColorizingWithColor: | (NSColor *) | color |
Creates a copy of the gradient but colorizies it by substituting the hue from <color>
color | donates its hue |
- (DKGradientInterpolation) gradientInterpolation |
Returns the interpolation algorithm for the gradient.
- (DKGradientType) gradientType |
- (DKGradient*) gradientWithAlpha: | (CGFloat) | alpha |
Creates a copy of the gradient but sets the alpha vealue of all stop colours to <alpha>
alpha | the desired alpha |
+ (DKGradient*) gradientWithStartingColor: | (NSColor *) | c1 | |
endingColor: | (NSColor *) | c2 | |
Returns a linear gradient from Color c1 to c2.
Gradient is linear and draws left to right c1 –> c2
c1 | the starting Color |
c2 | the ending Color |
+ (DKGradient*) gradientWithStartingColor: | (NSColor *) | c1 | |
endingColor: | (NSColor *) | c2 | |
type: | (NSInteger) | gt | |
angle: | (CGFloat) | degrees | |
Returns a gradient from Color c1 to c2 with given type and angle.
c1 | the starting Color |
c2 | the ending Color |
type | the gradient's type (linear or radial, etc) |
degrees | angle in degrees |
- (BOOL) hasRadialSettings |
Provided by category DKGradient(DKGradientExtensions).
- (void) insertObject: | (DKColorStop *) | stop | |
inColorStopsAtIndex: | (NSUInteger) | ix | |
- (NSPoint) mapPoint: | (NSPoint) | p | |
fromRect: | (NSRect) | rect | |
Provided by category DKGradient(DKGradientExtensions).
- (NSPoint) mapPoint: | (NSPoint) | p | |
toRect: | (NSRect) | rect | |
Provided by category DKGradient(DKGradientExtensions).
- (DKColorStop*) objectInColorStopsAtIndex: | (NSUInteger) | ix |
Returns the the indexed Color stop.
This also makes the stops array KVC compliant
ix | index number of the stop |
- (NSPoint) radialEndingPoint |
Provided by category DKGradient(DKGradientExtensions).
- (CGFloat) radialEndingRadius |
Provided by category DKGradient(DKGradientExtensions).
- (NSPoint) radialStartingPoint |
Provided by category DKGradient(DKGradientExtensions).
- (CGFloat) radialStartingRadius |
Provided by category DKGradient(DKGradientExtensions).
- (void) removeAllColors |
Removes all Colors from the list of Colors.
- (void) removeColorStop: | (DKColorStop *) | stop |
Removes a Color stop from the list of Colors.
stop | the stop to remove |
- (void) removeLastColor |
Removes the last Color from he list of Colors.
- (void) removeObjectFromColorStopsAtIndex: | (NSUInteger) | ix |
- (void) reverseColorStops |
Reverses the order of all the Color stops so "inverting" the gradient.
Stop positions are changed, but Colors are not touched
- (void) setAngle: | (CGFloat) | ang |
Sets the gradient's current angle in radians.
ang | the desired angle in radians |
- (void) setAngleInDegrees: | (CGFloat) | degrees |
Sets the angle of the gradient to the given angle.
degrees | the desired angle expressed in degrees |
- (void) setAngleWithoutNotifying: | (CGFloat) | ang |
- (void) setColorStops: | (NSArray *) | stops |
Sets the list of Color stops in the gradient.
A gradient needs a minimum of two Colors to be a gradient, but will function with one.
stops | an array of DKColorStop objects |
- (void) setGradientBlending: | (DKGradientBlending) | bt |
- (void) setGradientInterpolation: | (DKGradientInterpolation) | intrp |
- (void) setGradientType: | (DKGradientType) | gt |
Sets the gradient's basic type.
Valid types are: kDKGradientTypeLinear and kDKGradientTypeRadial
gt | the type |
- (void) setRadialEndingPoint: | (NSPoint) | p |
Provided by category DKGradient(DKGradientExtensions).
- (void) setRadialEndingRadius: | (CGFloat) | rad |
Provided by category DKGradient(DKGradientExtensions).
- (void) setRadialStartingPoint: | (NSPoint) | p |
Provided by category DKGradient(DKGradientExtensions).
- (void) setRadialStartingRadius: | (CGFloat) | rad |
Provided by category DKGradient(DKGradientExtensions).
- (void) setUpExtensionData |
Provided by category DKGradient(DKGradientExtensions).
- (void) sortColorStops |
Sorts the Color stops into position order.
Stops are sorted in place
+ (DKGradient*) sourceListSelectedGradient |
Provided by category DKGradient(UISupport).
+ (DKGradient*) sourceListUnselectedGradient |
Provided by category DKGradient(UISupport).
- (NSImage*) standardSwatchImage |
Returns an image of the current gradient for use in a UI, etc.
size | the desired image size |
showBorder | YES to draw a border around the image, NO for no border |
+ (DKGradient*) unifiedDarkGradient |
Provided by category DKGradient(UISupport).
+ (DKGradient*) unifiedNormalGradient |
Provided by category DKGradient(UISupport).
+ (DKGradient*) unifiedPressedGradient |
Provided by category DKGradient(UISupport).
+ (DKGradient*) unifiedSelectedGradient |
Provided by category DKGradient(UISupport).
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |