Companion

Default constructors for the RGB color model: the SRGB space.

Properties

Link copied to clipboard
open override val components: List<ColorComponentInfo>

Information about the components (sometimes called channels) of this color.

Link copied to clipboard
open override val matrixFromXyz: FloatArray

A 3×3 matrix stored in row-major order that transforms XYZ tristimulus values to linear-light values in this space.

Link copied to clipboard
open override val matrixToXyz: FloatArray

A 3×3 matrix stored in row-major order that transforms linear-light values in this space to XYZ tristimulus values.

Link copied to clipboard
open override val name: String

The name of this color

Link copied to clipboard

The TransferFunctions for this color space

Link copied to clipboard
open override val whitePoint: WhitePoint

The white point that colors in this space are calculated relative to.

Functions

Link copied to clipboard
open override fun convert(color: Color): RGB

Convert a color to this space

Link copied to clipboard

Create an RGBToRGBConverter that transforms RGB colors from this RGBColorSpace to the destination space.

Link copied to clipboard
open override fun create(components: FloatArray): RGB

Create a new instance of a color in this space from an array of components.

Link copied to clipboard

Create a chromatic adapter that will adapt colors from a given sourceWhite to this color space's reference white

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun from255(r: Int, g: Int, b: Int, alpha: Int): RGB

Construct an RGB instance from Int values in the range [0, 255].

Link copied to clipboard
open override fun grey(amount: Number, alpha: Number): RGB

Construct an RGB instance with a grey color from a fraction of white in range [0, 1]

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Build an interpolator that will produce colors in this color space.

fun <T : Color> ColorSpace<T>.interpolator(vararg stops: Color, premultiplyAlpha: Boolean = true): Interpolator<T>

Build a linear interpolator with two or more evenly spaced stops.

Link copied to clipboard
open operator override fun invoke(hex: String): RGB

Construct an RGB instance from a hex string with optional alpha channel.

open operator override fun invoke(r: Float, g: Float, b: Float, alpha: Float): RGB
open operator override fun invoke(r: Number, g: Number, b: Number, alpha: Number): RGB
Link copied to clipboard
fun <T : Color> ColorSpace<T>.mix(color1: Color, color2: Color, hueAdjustment: ComponentAdjustment = HueAdjustments.shorter): Color
fun <T : Color> ColorSpace<T>.mix(color1: Color, color2: Color, amount2: Number, hueAdjustment: ComponentAdjustment = HueAdjustments.shorter): Color
fun <T : Color> ColorSpace<T>.mix(color1: Color, amount1: Number, color2: Color, hueAdjustment: ComponentAdjustment = HueAdjustments.shorter): Color

fun <T : Color> ColorSpace<T>.mix(color1: Color, amount1: Number, color2: Color, amount2: Number, hueAdjustment: ComponentAdjustment = HueAdjustments.shorter): Color

Mix amount1 of color1 and amount2 of color2 in this color space.