LinearSrgb

data class LinearSrgb(r: Double, g: Double, b: Double) : Rgb

Linear representation of dev.kdrag0n.colorkt.rgb.Srgb. This is useful as an intermediate color space for conversions.

The sRGB non-linearity and its inverse are applied accurately, including the linear part of the piecewise function.

See also

Constructors

LinearSrgb
Link copied to clipboard
fun LinearSrgb(r: Double, g: Double, b: Double)

Types

Companion
Link copied to clipboard
object Companion

Functions

isInGamut
Link copied to clipboard
fun isInGamut(): Boolean

Check whether this color is within the sRGB gamut. This will return false if any component is either NaN or is not within the 0-1 range.

toSrgb
Link copied to clipboard
fun toSrgb(): Srgb

Convert this color to standard sRGB. This delinearizes the sRGB components.

Properties

b
Link copied to clipboard
open override val b: Double

Blue color component.

g
Link copied to clipboard
open override val g: Double

Green color component.

r
Link copied to clipboard
open override val r: Double

Red color component.

Extensions

toOklab
Link copied to clipboard
@JvmName(name = "fromLinearSrgb")
fun LinearSrgb.toOklab(): Oklab

Convert this color to the Oklab uniform color space.

toSrlab2
Link copied to clipboard
@JvmName(name = "fromLinearSrgb")
fun LinearSrgb.toSrlab2(): Srlab2

Convert this color to the SRLAB2 uniform color space.

toXyz
Link copied to clipboard
@JvmName(name = "fromLinearSrgb")
fun LinearSrgb.toXyz(): CieXyz

Convert a linear sRGB color (D65 white point) to the CIE XYZ color space.