Color

data class Color(@FloatRange(from = 0.0, to = 1.0) val red: Float, @FloatRange(from = 0.0, to = 1.0) val green: Float, @FloatRange(from = 0.0, to = 1.0) val blue: Float, @FloatRange(from = 0.0, to = 1.0) val alpha: Float = 1.0f)

A class that represents the Color property.

Important: This is a Public Preview API. It may be changed or removed at any time.

Parameters

red

The red component of the sRGB space. Must be between 0.0 and 1.0.

green

The green component of the sRGB space. Must be between 0.0 and 1.0.

blue

The blue component of the sRGB space. Must be between 0.0 and 1.0.

alpha

The alpha component of the sRGB space. Must be between 0.0 and 1.0.

Constructors

Link copied to clipboard
fun Color(rgbHexCode: Int, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1.0f)

Create a color using an sRGB color space.

Link copied to clipboard
fun Color(@FloatRange(from = 0.0, to = 1.0) red: Float, @FloatRange(from = 0.0, to = 1.0) green: Float, @FloatRange(from = 0.0, to = 1.0) blue: Float, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1.0f)

Create the color using an sRGB color space.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val alpha: Float = 1.0f
Link copied to clipboard
val blue: Float
Link copied to clipboard
Link copied to clipboard
val red: Float