HSL

class HSL(hue: Float, saturation: Float, lightness: Float, alpha: Float = 1.0f) : Color(source)

A color in the Hue-Saturation-Lightness (HSL) space.

The hue component is defined in degrees, so its value can range from 0f to 360f. The saturation and lightness components are defined as percentages, so their values can range from 0f to 1f. Any values outside of those ranges will be clamped to them.

Constructors

Link copied to clipboard
constructor(hue: Float, saturation: Float, lightness: Float, alpha: Float = 1.0f)

Properties

Link copied to clipboard

The alpha component for the color, from 0f to 1f

Link copied to clipboard
val hue: Float

The hue component for the color, from 0f to 360f

Link copied to clipboard

The lightness component for the color, from 0f to 1f

Link copied to clipboard

The saturation component for the color, from 0f to 1f

Functions

Link copied to clipboard
open override fun toHSL(): Color.HSL

Converts the color to the Hue-Saturation-Lightness (HSL) space.

Link copied to clipboard
open override fun toRGB(): Color.RGB

Converts the color to the Red-Green-Blue (RGB) space.

Link copied to clipboard
open override fun toString(): String