Hsl

class Hsl : Color(source)

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

See also: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl

Properties

Link copied to clipboard

A percentage value (0-1) representing how transparent the color is.

Link copied to clipboard
val hue: Float

An angle (0-360) representing the color based on its location in a color wheel.

Link copied to clipboard

Check if a color is perceived bright or not.

Link copied to clipboard

A percentage value (0-1) representing how bright the color is.

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.

Link copied to clipboard

A percentage value (0-1) representing how grey the color is.

Functions

Link copied to clipboard
fun copy(hue: Float = this.hue, saturation: Float = this.saturation, lightness: Float = this.lightness, alpha: Float = this.alpha): Color.Hsl
Link copied to clipboard
open override fun darkened(byPercent: Float): Color

Darken this color by some target percent value.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override 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
open override fun toHsl(): Color.Hsl
Link copied to clipboard
open override fun toRgb(): Color.Rgb
Link copied to clipboard
open override fun toString(): String