DrawKit
Vector and illustration framework for Mac OS X
|
Instance Methods | |
(NSColor *) | - colorWithHSBAverageFrom: |
Returns a colour by averaging the receiver with <color> in hsb space. More... | |
(NSColor *) | - colorWithHSBBlendFrom:blendingAmounts: |
Returns a colour by blending the receiver with <color> in hsb space. More... | |
(NSColor *) | - colorWithHueAndSaturationFrom: |
Returns a copy ofthe receiver but substituting the hue and saturation from the given colour. More... | |
(NSColor *) | - colorWithHueFrom: |
Returns a copy ofthe receiver but substituting the hue from the given colour. More... | |
(NSColor *) | - colorWithLuminosity |
Returns a grey rgb colour having the same luminosity as the receiver. More... | |
(NSColor *) | - colorWithRGBAverageFrom: |
Returns a colour by averaging the receiver with <color> in rgb space. More... | |
(NSColor *) | - colorWithRGBBlendFrom:blendingAmounts: |
Returns a colour by blending the receiver with <color> in rgb space. More... | |
(NSColor *) | - contrastingColor |
Returns black or white to give best contrast with the receiver's colour. More... | |
(NSColor *) | - darkerColorWithLevel: |
Returns a darker colour based on a blend between the receiver and black. More... | |
(NSString *) | - hexString |
Returns a standard web-formatted hexadecimal representation of the receiver's colour. More... | |
(NSColor *) | - interpolatedColorToColor:atValue: |
Returns a colour by interpolating between the receiver and a second colour. More... | |
(NSColor *) | - invertedColor |
Returns the colour with each colour component subtracted from 1. More... | |
(NSColor *) | - lighterColorWithLevel: |
Returns a lighter colour based on a blend between the receiver and white. More... | |
(CGFloat) | - luminosity |
Returns the luminosity value of the receiver. More... | |
(CGColorRef) | - newQuartzColor |
Returns a quartz CGColorRef corresponding to the receiver's colours. More... | |
Class Methods | |
(NSColor *) | + colorByInterpolatingFrom:to:atValue: |
Returns a colour by interpolating between two colours. More... | |
(NSColor *) | + colorWithHexString: |
Returns an RGB colour corresponding to the standard-formatted HTML hexadecimal colour string. More... | |
(NSColor *) | + colorWithWavelength: |
Returns an RGB colour approximating the wavelength. More... | |
(NSColor *) | + contrastingColor: |
(NSColor *) | + rgbBlack |
Returns the colour black as an RGB Color. More... | |
(NSColor *) | + rgbGrey: |
Returns a grey RGB colour. More... | |
(NSColor *) | + rgbGrey:withAlpha: |
Returns a grey RGB colour. More... | |
(NSColor *) | + rgbGreyWithLuminosityFrom:withAlpha: |
Returns a grey RGB colour with the same perceived brightness as the source colour. More... | |
(NSColor *) | + rgbWhite |
Returns the colour white as an RGB Color. More... | |
(NSColor *) | + veryLightGrey |
A very light grey colour. More... | |
+ (NSColor*) colorByInterpolatingFrom: | (NSColor *) | startColor | |
to: | (NSColor *) | endColor | |
atValue: | (CGFloat) | interpValue | |
Returns a colour by interpolating between two colours.
startColor | a colour |
endColor | a second colour |
interpValue | a value between 0 and 1 |
Returns an RGB colour corresponding to the standard-formatted HTML hexadecimal colour string.
hex | a string formatted '#RRGGBB' |
Returns a colour by averaging the receiver with <color> in hsb space.
Input colours must be in RGB colour space
color | average with this colour |
Returns a colour by blending the receiver with <color> in hsb space.
color | blend with this colour |
blendingAmounts | an array of four values, each 0..1, specifies how components from each colour are |
Returns a copy ofthe receiver but substituting the hue and saturation from the given colour.
Input colours must be in RGB colour space
color | donates hue and saturation |
Returns a copy ofthe receiver but substituting the hue from the given colour.
If the receiver is black or white or otherwise fully unsaturated, colourization may not produce visible results. Input colours must be in RGB colour space
color | donates hue |
- (NSColor*) colorWithLuminosity |
Returns a grey rgb colour having the same luminosity as the receiver.
Returns a colour by averaging the receiver with <color> in rgb space.
Input colours must be in RGB colour space
color | average with this colour |
Returns a colour by blending the receiver with <color> in rgb space.
color | blend with this colour |
blendingAmounts | an array of four values, each 0..1, specifies how components from each colour are |
Returns an RGB colour approximating the wavelength.
Lambda range outside 380 to 780 (nm) returns black
lambda | the wavelength in nanometres |
- (NSColor*) contrastingColor |
Returns black or white to give best contrast with the receiver's colour.
Returns a darker colour based on a blend between the receiver and black.
The alpha value is unchanged
amount | a value 0.0..1.0, 0 returns the original colour, 1 returns black. |
- (NSString*) hexString |
Returns a standard web-formatted hexadecimal representation of the receiver's colour.
Format is '#000000' (black) to '#FFFFFF' (white)
Returns a colour by interpolating between the receiver and a second colour.
secondColour | another colour |
interpValue | a value between 0 and 1 |
- (NSColor*) invertedColor |
Returns the colour with each colour component subtracted from 1.
The alpha value is not inverted
Returns a lighter colour based on a blend between the receiver and white.
The alpha value is unchanged
amount | a value 0.0..1.0, 0 returns the original colour, 1 returns white. |
- (CGFloat) luminosity |
Returns the luminosity value of the receiver.
Luminosity of a colour is both subjective and dependent on the display characteristics of particular monitors, etc. A frequently used formula can be traced to experiments done by the NTSC television standards committee in 1953, which was based on tube phosphors in common use at that time. A more modern formula is applicable for LCD monitors. This method uses the NTSC formula if NTSC_1953_STANDARD is defined, otherwise the modern one.
- (CGColorRef) newQuartzColor |
Returns a quartz CGColorRef corresponding to the receiver's colours.
Returned colour uses the generic RGB colour space, regardless of the receivers colourspace. Caller is responsible for releasing the colour ref when done.
+ (NSColor*) rgbBlack |
Returns the colour black as an RGB Color.
Uses the RGB Color space, not the greyscale Colorspace you get with NSColor's blackColor method.
Returns a grey RGB colour.
Uses the RGB Color space, not the greyscale Colorspace you get with NSColor's grey method.
grayscale | 0 to 1.0 |
Returns a grey RGB colour.
Uses the RGB Color space, not the greyscale Colorspace you get with NSColor's grey method.
grayscale | 0 to 1.0 |
alpha | 0 to 1.0 |
Returns a grey RGB colour with the same perceived brightness as the source colour.
colour | any colour |
alpha | 0 to 1.0 |
+ (NSColor*) rgbWhite |
Returns the colour white as an RGB Color.
Uses the RGB Color space, not the greyscale Colorspace you get with NSColor's whiteColor method.
+ (NSColor*) veryLightGrey |
A very light grey colour.