Package-level declarations

Types

Link copied to clipboard

Allows performing select algebraic operations on colors of this kind.

Link copied to clipboard
interface ChromaColor<T>
Link copied to clipboard
@Serializable
data class ColorHSLa @JvmOverloads constructor(val h: Double, val s: Double, val l: Double, val alpha: Double = 1.0) : ColorModel<ColorHSLa> , ShadableColor<ColorHSLa> , HueShiftableColor<ColorHSLa> , SaturatableColor<ColorHSLa> , AlgebraicColor<ColorHSLa>
Link copied to clipboard
@Serializable
data class ColorHSVa @JvmOverloads constructor(val h: Double, val s: Double, val v: Double, val alpha: Double = 1.0) : ColorModel<ColorHSVa> , ShadableColor<ColorHSVa> , HueShiftableColor<ColorHSVa> , SaturatableColor<ColorHSVa> , AlgebraicColor<ColorHSVa>
Link copied to clipboard
@Serializable
data class ColorLABa @JvmOverloads constructor(val l: Double, val a: Double, val b: Double, val alpha: Double = 1.0, val ref: ColorXYZa = ColorXYZa.NEUTRAL) : ColorModel<ColorLABa> , ReferenceWhitePoint, ShadableColor<ColorLABa> , LuminosityColor<ColorLABa> , AlgebraicColor<ColorLABa>

The CIELAB color space, more commonly known as Lab.

Link copied to clipboard
@Serializable
data class ColorLCHABa @JvmOverloads constructor(val l: Double, val c: Double, val h: Double, val alpha: Double = 1.0, val ref: ColorXYZa = ColorXYZa.NEUTRAL) : ColorModel<ColorLCHABa> , ReferenceWhitePoint, ShadableColor<ColorLCHABa> , ChromaColor<ColorLCHABa> , HueShiftableColor<ColorLCHABa> , LuminosityColor<ColorLCHABa> , AlgebraicColor<ColorLCHABa>

The CIELChAB color space is the cylindrical representation of the CIELAB color space.

Link copied to clipboard
@Serializable
data class ColorLCHUVa @JvmOverloads constructor(val l: Double, val c: Double, val h: Double, val alpha: Double = 1.0, val ref: ColorXYZa = ColorXYZa.NEUTRAL) : ColorModel<ColorLCHUVa> , ReferenceWhitePoint, ShadableColor<ColorLCHUVa> , ChromaColor<ColorLCHUVa> , HueShiftableColor<ColorLCHUVa> , LuminosityColor<ColorLCHUVa> , AlgebraicColor<ColorLCHUVa>

The CIELChUV color space is the cylindrical representation of the CIELUV color space.

Link copied to clipboard
@Serializable
data class ColorLSHABa @JvmOverloads constructor(val l: Double, val s: Double, val h: Double, val alpha: Double = 1.0, val ref: ColorXYZa = ColorXYZa.NEUTRAL) : ColorModel<ColorLSHABa> , ReferenceWhitePoint, HueShiftableColor<ColorLSHABa> , SaturatableColor<ColorLSHABa> , LuminosityColor<ColorLSHABa> , AlgebraicColor<ColorLSHABa>

Based on ColorLCHABa, but instead tries to use a normalized chroma.

Link copied to clipboard
@Serializable
data class ColorLSHUVa @JvmOverloads constructor(val l: Double, val s: Double, val h: Double, val alpha: Double = 1.0, val ref: ColorXYZa = ColorXYZa.NEUTRAL) : ColorModel<ColorLSHUVa> , ReferenceWhitePoint, HueShiftableColor<ColorLSHUVa> , SaturatableColor<ColorLSHUVa> , LuminosityColor<ColorLSHUVa> , AlgebraicColor<ColorLSHUVa>

Based on ColorLCHUVa, but instead tries to use a normalized chroma.

Link copied to clipboard
@Serializable
data class ColorLUVa @JvmOverloads constructor(val l: Double, val u: Double, val v: Double, val alpha: Double = 1.0, val ref: ColorXYZa) : ColorModel<ColorLUVa> , ReferenceWhitePoint, ShadableColor<ColorLUVa> , LuminosityColor<ColorLUVa> , AlgebraicColor<ColorLUVa>
Link copied to clipboard
@Serializable
data class ColorRGBa @JvmOverloads constructor(val r: Double, val g: Double, val b: Double, val alpha: Double = 1.0, val linearity: Linearity = Linearity.UNKNOWN) : ColorModel<ColorRGBa> , ShadableColor<ColorRGBa> , AlgebraicColor<ColorRGBa>

A generic RGB color space capable of representing both the linear and the sRGB color spaces.

Link copied to clipboard
@Serializable
data class ColorXSLa @JvmOverloads constructor(val x: Double, val s: Double, val l: Double, val alpha: Double = 1.0) : ColorModel<ColorXSLa> , ShadableColor<ColorXSLa> , HueShiftableColor<ColorXSLa> , SaturatableColor<ColorXSLa> , AlgebraicColor<ColorXSLa>

Practically identical to ColorHSLa, but for mapping colors to classical painter's scheme of complementary colors.

Link copied to clipboard
@Serializable
data class ColorXSVa @JvmOverloads constructor(val x: Double, val s: Double, val v: Double, val alpha: Double = 1.0) : ColorModel<ColorXSVa> , ShadableColor<ColorXSVa> , HueShiftableColor<ColorXSVa> , SaturatableColor<ColorXSVa> , AlgebraicColor<ColorXSVa>

Practically identical to ColorHSVa, but for mapping colors to classical painter's scheme of complementary colors.

Link copied to clipboard
@Serializable
data class ColorXYZa @JvmOverloads constructor(val x: Double, val y: Double, val z: Double, val alpha: Double = 1.0) : ColorModel<ColorXYZa> , AlgebraicColor<ColorXYZa>
Link copied to clipboard
@Serializable
data class ColorYxya @JvmOverloads constructor(val yy: Double, val x: Double, val y: Double, val alpha: Double = 1.0) : ColorModel<ColorYxya>

The Yxy color space, also known as the xyY color space.

Link copied to clipboard
Link copied to clipboard
interface HueShiftableColor<T>
Link copied to clipboard
@Serializable
enum Linearity : Enum<Linearity>
Link copied to clipboard
interface LuminosityColor<T>
Link copied to clipboard
interface OpacifiableColor<T>
Link copied to clipboard
Link copied to clipboard
interface SaturatableColor<T>
Link copied to clipboard
interface ShadableColor<T>

Functions

Link copied to clipboard
fun findHue(id: Int): Hue?
Link copied to clipboard
fun hsl(h: Double, s: Double, l: Double, a: Double = 1.0): ColorHSLa
Link copied to clipboard
fun hsv(h: Double, s: Double, v: Double, a: Double = 1.0): ColorHSVa
Link copied to clipboard
fun mix(left: ColorHSLa, right: ColorHSLa, x: Double): ColorHSLa

Weighted mix between two colors in the HSL color space.

fun mix(left: ColorHSVa, right: ColorHSVa, x: Double): ColorHSVa

Weighted mix between two colors in the HSVa color space.

fun mix(left: ColorLCHABa, right: ColorLCHABa, x: Double): ColorLCHABa

Weighted mix between two colors in the LChAB color space.

fun mix(left: ColorLCHUVa, right: ColorLCHUVa, x: Double): ColorLCHUVa

Weighted mix between two colors in the LChUV color space.

fun mix(left: ColorRGBa, right: ColorRGBa, x: Double): ColorRGBa

Weighted mix between two colors in the generic RGB color space.

fun mix(left: ColorXSLa, right: ColorXSLa, x: Double): ColorXSLa

Weighted mix between two colors in the XSL color space.

fun mix(left: ColorXSVa, right: ColorXSVa, x: Double): ColorXSVa

Weighted mix between two colors in the XSV color space.

Link copied to clipboard
fun rgb(hex: String): ColorRGBa

Shorthand for calling ColorRGBa.fromHex. Creates a ColorRGBa from a hex string.

fun rgb(gray: Double, a: Double = 1.0): ColorRGBa

Shorthand for calling ColorRGBa.

fun rgb(r: Double, g: Double, b: Double, a: Double = 1.0): ColorRGBa

Shorthand for calling ColorRGBa. Specify only one value to obtain a shade of gray.

Link copied to clipboard
operator fun Matrix55.times(color: ColorRGBa): ColorRGBa

Properties

Link copied to clipboard
val hues: List<Hue>