hueComponent
カラーのHSBの色度値を返します
解説
カラーのHSBの色度値を返します。
カラーがRGBカラーでなければ、例外を起こします。
返り値
( CGFloat )
色度値
引数
フレームワーク
ApplicationKit
クラス
NSColor
Instance Methods
使用可能
10.0
参照
- getHue:saturation:brightness:alpha:
例文
#import "Controller.h" @implementation Controller - (IBAction)myAction:(id)sender { NSColor *theColor = [NSColor colorWithDeviceHue:1 saturation:0.3 brightness:0.8 alpha:1];//カラー作成 [name setStringValue:@"HueColor"];//outlet nameに文字をセット [name setTextColor:theColor];//outlet name(text field)の文字色をtheColorにする [h setFloatValue:[theColor hueComponent]];// [s setFloatValue:[theColor greenComponent]];// [b setFloatValue:[theColor brightnessComponent]];// [alpha setFloatValue:[theColor alphaComponent]];// } @end