RGBColorSpace

Types

Link copied to clipboard

A transfer function and its inverse defined with a pure gamma exponent.

Link copied to clipboard

A set of identity functions that leave values unchanged.

Link copied to clipboard

Color Component Transfer Functions (CCTFs) for encoding and decoding components of RGB color spaces.

Properties

Link copied to clipboard

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

Link copied to clipboard

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
abstract 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
abstract val name: String

The name of this color

Link copied to clipboard
Link copied to clipboard
abstract val whitePoint: WhitePoint

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

Functions

Link copied to clipboard
abstract 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
abstract 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 fun from255(r: Int, g: Int, b: Int, alpha: Int = 255): RGB

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

Link copied to clipboard
open fun grey(amount: Number, alpha: Number = 1.0f): RGB

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

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 fun invoke(hex: String): RGB

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

abstract operator fun invoke(r: Float, g: Float, b: Float, alpha: Float = 1.0f): RGB
open operator fun invoke(r: Number, g: Number, b: Number, alpha: Number = 1.0f): 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.