Color

sealed interface Color : CSSColorValue(source)

A base class for colors which provides additional functionality on top of the color class included in Compose HTML.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Hsl : Color

A representation for a color specified via hue, saturation, and lightness values.

Link copied to clipboard
class Rgb : Color

Properties

Link copied to clipboard

Check if a color is perceived bright or not.

Link copied to clipboard

Calculate a color's luminance, which is a calculation for how bright it is perceived to be by the human eye.

Functions

Link copied to clipboard
abstract fun darkened(byPercent: Float = DEFAULT_SHIFTING_PERCENT): Color

Darken this color by some target percent value.

Link copied to clipboard
abstract fun inverted(): Color
Link copied to clipboard
fun Color.lightened(byPercent: Float = Color.DEFAULT_SHIFTING_PERCENT): Color

Lighten this color by some target percent value.

Link copied to clipboard
abstract fun toHsl(): Color.Hsl
Link copied to clipboard
abstract fun toRgb(): Color.Rgb