alphaComponent
カラーのアルファ(不透明度)値を返します
解説
カラーのアルファ(不透明度)値を返します。
カラーがアルファを持たなければ1.0を返します。
返り値
( CGFloat )
不透明度0.0-1.0
引数
フレームワーク
ApplicationKit
クラス
NSColor
Instance Methods
使用可能
10.0
参照
例文
#import "Controller.h" @implementation Controller - (IBAction)myAction:(id)sender { NSColor *theColor = [NSColor colorWithDeviceRed:1 green:0.3 blue:0.8 alpha:1]; [name setStringValue:@"r1:g0.3:b0.8:alpha1"]; [name setTextColor:theColor]; [r setFloatValue:[theColor redComponent]]; [g setFloatValue:[theColor greenComponent]]; [b setFloatValue:[theColor blueComponent]]; [alpha setFloatValue:[theColor alphaComponent]]; } @end