Zcam

data class Zcam(brightness: Double, lightness: Double, colorfulness: Double, chroma: Double, hue: Double, saturation: Double, vividness: Double, blackness: Double, whiteness: Double, viewingConditions: Zcam.ViewingConditions) : Color, Lch

A color modeled by the ZCAM color appearance model, which provides a variety of perceptual color attributes. This color appearance model is designed with HDR in mind so it only accepts absolute CIE XYZ values scaled by the absolute luminance of the modeled display, unlike SDR color spaces that accept relative luminance.

Most attributes are optional in the constructor because don't need to be present together. All ZCAM colors must have: - brightness OR lightness - colorfulness OR chroma OR saturation OR vividness OR blackness OR whiteness - hue - viewing conditions

See also

Constructors

Zcam
Link copied to clipboard
fun Zcam(brightness: Double = Double.NaN, lightness: Double = Double.NaN, colorfulness: Double = Double.NaN, chroma: Double = Double.NaN, hue: Double, saturation: Double = Double.NaN, vividness: Double = Double.NaN, blackness: Double = Double.NaN, whiteness: Double = Double.NaN, viewingConditions: Zcam.ViewingConditions)

Types

ChromaSource
Link copied to clipboard
enum ChromaSource : Enum<Zcam.ChromaSource>

ZCAM attributes that can be used to calculate chroma (colorfulness) in the inverse model.

Companion
Link copied to clipboard
object Companion
LuminanceSource
Link copied to clipboard
enum LuminanceSource : Enum<Zcam.LuminanceSource>

ZCAM attributes that can be used to calculate luminance in the inverse model.

ViewingConditions
Link copied to clipboard
data class ViewingConditions(surroundFactor: Double, adaptingLuminance: Double, backgroundLuminance: Double, referenceWhite: CieXyzAbs)

The conditions under which a color modeled by ZCAM will be viewed. This is defined by the luminance of the adapting field, luminance of the background, and surround factor.

Functions

toXyzAbs
Link copied to clipboard
fun toXyzAbs(luminanceSource: Zcam.LuminanceSource, chromaSource: Zcam.ChromaSource): CieXyzAbs

Convert this color to the CIE XYZ color space, with absolute luminance.

Properties

blackness
Link copied to clipboard
val blackness: Double

Amount of black. 2D attribute.

brightness
Link copied to clipboard
val brightness: Double

Absolute brightness.

chroma
Link copied to clipboard
open override val chroma: Double

Colorfulness relative to the reference white.

colorfulness
Link copied to clipboard
val colorfulness: Double

Absolute colorfulness.

Cz
Link copied to clipboard
val Cz: Double

Alias for chroma.

hue
Link copied to clipboard
open override val hue: Double

Hue from 0 to 360 degrees.

hz
Link copied to clipboard
val hz: Double

Alias for hue.

Jz
Link copied to clipboard
val Jz: Double

Alias for lightness.

Kz
Link copied to clipboard
val Kz: Double

Alias for blackness.

lightness
Link copied to clipboard
open override val lightness: Double

Brightness relative to the reference white, from 0 to 100.

Mz
Link copied to clipboard
val Mz: Double

Alias for colorfulness.

Qz
Link copied to clipboard
val Qz: Double

Alias for brightness.

saturation
Link copied to clipboard
val saturation: Double

Chroma relative to lightness. 2D attribute.

Sz
Link copied to clipboard
val Sz: Double

Alias for saturation.

viewingConditions
Link copied to clipboard
val viewingConditions: Zcam.ViewingConditions

Viewing conditions used to model this color.

vividness
Link copied to clipboard
val vividness: Double

Distance from neutral black. 2D attribute.

Vz
Link copied to clipboard
val Vz: Double

Alias for vividness.

whiteness
Link copied to clipboard
val whiteness: Double

Amount of white. 2D attribute.

Wz
Link copied to clipboard
val Wz: Double

Alias for whiteness.

Extensions

clipToLinearSrgb
Link copied to clipboard
fun Zcam.clipToLinearSrgb(method: LchGamut.ClipMethod = ClipMethod.PRESERVE_LIGHTNESS, alpha: Double = 0.05): LinearSrgb

Convert this ZCAM color to linear sRGB, and clip it to sRGB gamut boundaries if it's not already within gamut.