语言

ColorObject.GetComponent(Int32) 方法

定义

返回此颜色的颜色空间定义的区域中指定组件的值(见 ColorSpace#getMinValue(int) 和 ColorSpace#getMaxValue(int))。

[Android.Runtime.Register("getComponent", "(I)F", "GetGetComponent_IHandler", ApiSince=26)]
public virtual float GetComponent(int component);
[<Android.Runtime.Register("getComponent", "(I)F", "GetGetComponent_IHandler", ApiSince=26)>]
abstract member GetComponent : int -> single
override this.GetComponent : int -> single

参数

component
Int32

值介于 0 和 4 之间(含 0)

返回

选定存储的组件,包括选定索引时的 alpha。

特性

注解

返回此颜色的颜色空间定义的区域中指定组件的值(见 ColorSpace#getMinValue(int) 和 ColorSpace#getMaxValue(int))。

如果请求的组件索引为 #getComponentCount(),此方法将返回 alpha 分量,始终位于 \([0..1]\) 范围内。

Java文档android.graphics.Color.getComponent(int)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于