core-ktx / androidx.graphics / android.graphics.Color / component1

component1

inline operator fun Color.component1(): Float

Returns the first component of the color. For instance, when the color model of the color is android.graphics.ColorSpace.Model.RGB, the first component is "red".

This method allows to use destructuring declarations when working with colors, for example:

val (red, green, blue) = myColor