core-ktx / androidx.graphics / kotlin.Long

Extensions for kotlin.Long

alpha

val Long.alpha: Float

Return the alpha component of a color long. This is equivalent to calling:

blue

val Long.blue: Float

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

colorSpace

val Long.colorSpace: ColorSpace

Returns the color space encoded in the specified color long.

component1

operator fun Long.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".

component2

operator fun Long.component2(): Float

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

component3

operator fun Long.component3(): Float

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

component4

operator fun Long.component4(): Float

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".

green

val Long.green: Float

Return the green component of a color long. This is equivalent to calling:

isSrgb

val Long.isSrgb: Boolean

Indicates whether the color is in the sRGB color space.

isWideGamut

val Long.isWideGamut: Boolean

Indicates whether the color is in a wide-gamut color space.

luminance

val Long.luminance: Float

Returns the relative luminance of a color. Based on the formula for relative luminance defined in WCAG 2.0, W3C Recommendation 11 December 2008.

red

val Long.red: Float

Return the red component of a color long. This is equivalent to calling:

toColor

fun Long.toColor(): Color

Creates a new Color instance from a color long.

toColorInt

fun Long.toColorInt(): Int

Converts the specified color long to an ARGB color int.