component4

@RequiresApi(value = 26)
inline operator fun Color.component4(): Float(source)

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

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

val (red, green, blue, alpha) = myColor

inline operator fun Int.component4(): Int(source)

Return the blue component of a color int. This is equivalent to calling:

Color.blue(myInt)

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

val (alpha, red, green, blue) = myColor

@RequiresApi(value = 26)
inline operator fun Long.component4(): Float(source)

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

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

val (red, green, blue, alpha) = myColorLong

inline operator fun Rect.component4(): Int(source)
inline operator fun RectF.component4(): Float(source)

Returns "bottom", the fourth component of the rectangle.

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

val (left, top, right, bottom) = myRectangle