Cam16

CAM16, a color appearance model. Colors are not just defined by their hex code, but rather, a hex code and viewing conditions.

CAM16 instances also have coordinates in the CAM16-UCS space, called J*, a*, b*, or jstar, astar, bstar in code. CAM16-UCS is included in the CAM16 specification, and should be used when measuring distances between colors.

In traditional color spaces, a color can be identified solely by the observer's measurement of the color. Color appearance models such as CAM16 also use information about the environment where the color was observed, known as the viewing conditions.

For example, white under the traditional assumption of a midday sun white point is accurately measured as a slightly chromatic blue by CAM16. (roughly, hue 203, chroma 3, lightness 100)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val hue: Double
Link copied to clipboard
val j: Double
Link copied to clipboard
Link copied to clipboard
val m: Double
Link copied to clipboard
val q: Double
Link copied to clipboard
val s: Double

Functions

Link copied to clipboard
open fun fromInt(argb: Int): Cam16
Create a CAM16 color from a color, assuming the color was viewed in default viewing conditions.
Link copied to clipboard
open fun fromUcs(jstar: Double, astar: Double, bstar: Double): Cam16
Create a CAM16 color from CAM16-UCS coordinates.
Link copied to clipboard
open fun fromUcsInViewingConditions(jstar: Double, astar: Double, bstar: Double, viewingConditions: ViewingConditions): Cam16
Create a CAM16 color from CAM16-UCS coordinates in defined viewing conditions.
Link copied to clipboard
open fun toInt(): Int
ARGB representation of the color.