NSGradient:interpolatedColorAtLocation:
Home 目次>ApplicationKit>NSGradient
10.5

interpolatedColorAtLocation:

グラデーションオブジェクトの指定した場所のカラーを返します


-(NSColor *) interpolatedColorAtLocation:(CGFloat)location


【返り値】
   NSColor *カラーオブジェクト
【パラメータ】
   location調べる場所(0.0-1.0)


【解説】

グラデーションオブジェクトの指定した場所のカラーを返します。



【例文】


#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSGradient *gradient = [[NSGradient alloc] initWithColors:
[NSArray arrayWithObjects:
[NSColor redColor],
[NSColor greenColor],
[NSColor blueColor],
nil
]
];
[theView lockFocus];

[gradient drawInRect: NSMakeRect(0,0,100,100)
angle: (CGFloat)30.0
];


[theView unlockFocus];

NSLog([[gradient interpolatedColorAtLocation:0.3] description]);
}

@end


(C) 2000-2007 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSGradient
修正日2006.12.26