View source

abstract thx.color.Xyz(Array<Float>)

Available on all platforms

The CIE XYZ color space encompasses all color sensations that an average person can experience. It serves as a standard reference against which many other color spaces are defined. A set of color-matching functions, like the spectral sensitivity curves of the LMS space but not restricted to be nonnegative sensitivities, associates physically produced light spectra with specific tristimulus values.

When judging the relative luminance (brightness) of different colors in well-lit situations, humans tend to perceive light within the green parts of the spectrum as brighter than red or blue light of equal power. The luminosity function that describes the perceived brightnesses of different wavelengths is thus roughly analogous to the spectral sensitivity of M cones.

The CIE model capitalises on this fact by defining Y as luminance. Z is quasi-equal to blue stimulation, or the S cone response, and X is a mix (a linear combination) of cone response curves chosen to be nonnegative. The XYZ tristimulus values are thus analogous to, but different to, the LMS cone responses of the human eye. Defining Y as luminance has the useful result that for any given Y value, the XZ plane will contain all possible chromaticities at that luminance.

Class Fields

var epsilon(default,null):Float

var kappa(default,null):Float

var whiteReference(default,null):Xyz

inline function create(x:Float, y:Float, z:Float):Xyz

function fromFloats(arr:Array<Float>):Xyz

function fromString(color:String):Null<Xyz>

Instance Fields

var u(get,null):Float

var v(get,null):Float

var x(get,null):Float

var y(get,null):Float

var z(get,null):Float

function equals(other:Xyz):Bool

function interpolate(other:Xyz, t:Float):Xyz

function max(other:Xyz):Xyz

function min(other:Xyz):Xyz

function nearEquals(other:Xyz, tolerance:Float = Floats.EPSILON):Bool

function roundTo(decimals:Int):Xyz

function toCmy():Cmy

function toCmyk():Cmyk

function toGrey():Grey

function toHsl():Hsl

function toHsv():Hsv

function toLCh():LCh

function toLab():Lab

function toLuv():Luv

function toRgb():Rgb

function toRgba():Rgba

function toRgbx():Rgbx

function toRgbxa():Rgbxa

function toString():String

function toYuv():Yuv

function toYxy():Yxy

function withX(newx:Float):Xyz

function withY(newy:Float):Xyz

function withZ(newz:Float):Xyz