Share via


CGColor 构造函数

定义

重载

CGColor(IntPtr)
CGColor(String)
CGColor(CGColor, nfloat)

使用指定的 alpha 值从现有颜色创建颜色。

CGColor(CGColorSpace, nfloat[])

使用指定分量在颜色空间上创建颜色。

CGColor(nfloat, nfloat)

从灰色值和 alpha 值创建颜色。

CGColor(CGColorSpace, CGPattern, nfloat[])

使用指定的颜色空间、图案和分量创建颜色。

CGColor(nfloat, nfloat, nfloat)

从红色、绿色和蓝色分量创建颜色。

CGColor(nfloat, nfloat, nfloat, nfloat)

从红色、绿色、蓝色和 alpha 分量创建颜色。

CGColor(IntPtr)

public CGColor (IntPtr handle);
new CoreGraphics.CGColor : nativeint -> CoreGraphics.CGColor

参数

handle
IntPtr

nativeint

适用于

CGColor(String)

public CGColor (string name);
new CoreGraphics.CGColor : string -> CoreGraphics.CGColor

参数

name
String

适用于

CGColor(CGColor, nfloat)

使用指定的 alpha 值从现有颜色创建颜色。

public CGColor (CoreGraphics.CGColor source, nfloat alpha);
new CoreGraphics.CGColor : CoreGraphics.CGColor * nfloat -> CoreGraphics.CGColor

参数

source
CGColor

要使用的参考颜色。

alpha
nfloat

Alpha 值从 0.0f 到 1.0f。

适用于

CGColor(CGColorSpace, nfloat[])

使用指定分量在颜色空间上创建颜色。

public CGColor (CoreGraphics.CGColorSpace colorspace, nfloat[] components);
new CoreGraphics.CGColor : CoreGraphics.CGColorSpace * nfloat[] -> CoreGraphics.CGColor

参数

colorspace
CGColorSpace
components
nfloat[]

颜色空间中每个通道的颜色强度为 1。 它应包含 alpha 通道。

注解

如果组件中的任何值超出组件的范围,则该值将被固定。

适用于

CGColor(nfloat, nfloat)

从灰色值和 alpha 值创建颜色。

public CGColor (nfloat gray, nfloat alpha);
new CoreGraphics.CGColor : nfloat * nfloat -> CoreGraphics.CGColor

参数

gray
nfloat

灰色值从 0.0f 到 1.0f。

alpha
nfloat

Alpha 值从 0.0f 到 1.0f。

适用于

CGColor(CGColorSpace, CGPattern, nfloat[])

使用指定的颜色空间、图案和分量创建颜色。

public CGColor (CoreGraphics.CGColorSpace colorspace, CoreGraphics.CGPattern pattern, nfloat[] components);
new CoreGraphics.CGColor : CoreGraphics.CGColorSpace * CoreGraphics.CGPattern * nfloat[] -> CoreGraphics.CGColor

参数

colorspace
CGColorSpace
pattern
CGPattern

要使用的模式。

components
nfloat[]

颜色空间中每个通道的颜色强度为 1。 它应包含 alpha 通道。

适用于

CGColor(nfloat, nfloat, nfloat)

从红色、绿色和蓝色分量创建颜色。

public CGColor (nfloat red, nfloat green, nfloat blue);
new CoreGraphics.CGColor : nfloat * nfloat * nfloat -> CoreGraphics.CGColor

参数

red
nfloat

红色值 0.0f 到 1.0f。

green
nfloat

绿色值从 0.0f 到 1.0f。

blue
nfloat

蓝色值从 0.0f 到 1.0f。

适用于

CGColor(nfloat, nfloat, nfloat, nfloat)

从红色、绿色、蓝色和 alpha 分量创建颜色。

public CGColor (nfloat red, nfloat green, nfloat blue, nfloat alpha);
new CoreGraphics.CGColor : nfloat * nfloat * nfloat * nfloat -> CoreGraphics.CGColor

参数

red
nfloat

红色值从 0.0f 到 1.0f。

green
nfloat

绿色值从 0.0f 到 1.0f。

blue
nfloat

蓝色值从 0.0f 到 1.0f。

alpha
nfloat

Alpha 值从 0.0f 到 1.0f。

适用于