Cam16 class Null safety
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) 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)
Constructors
- Cam16(double hue, double chroma, double j, double q, double m, double s, double jstar, double astar, double bstar)
-
All of the CAM16 dimensions can be calculated from 3 of the dimensions, in
the following combinations:
- {j or q} and {c, m, or s} and hue
- jstar, astar, bstar
Prefer using a static method that constructs from 3 of those dimensions.
This constructor is intended for those methods to use to return all
possible dimensions.
const
Properties
- astar → double
-
CAM16-UCS a coordinate
final
- bstar → double
-
CAM16-UCS b coordinate
final
- chroma → double
-
Informally, colorfulness / color intensity. Like saturation in HSL,
except perceptually accurate.
final
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- hue → double
-
Like red, orange, yellow, green, etc.
final
- j → double
-
Lightness
final
- jstar → double
-
CAM16-UCS J coordinate
final
- m → double
-
Colorfulness
final
- q → double
-
Brightness; ratio of lightness to white point's lightness
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- s → double
-
Saturation; ratio of chroma to white point's chroma
final
Methods
-
distance(
Cam16 other) → double - 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.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toInt(
) → int - ARGB representation of color, assuming the color was viewed in default viewing conditions.
-
toString(
) → String -
A string representation of this object.
inherited
-
viewed(
ViewingConditions viewingConditions) → int -
ARGB representation of a color, given the color was viewed in
viewingConditions
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromInt(
int argb) → Cam16 -
Convert
argb
to CAM16, assuming the color was viewed in default viewing conditions. -
fromIntInViewingConditions(
int argb, ViewingConditions viewingConditions) → Cam16 -
Given
viewingConditions
, convertargb
to CAM16. -
fromJch(
double j, double c, double h) → Cam16 -
Create a CAM16 color from lightness
j
, chromac
, and hueh
, assuming the color was viewed in default viewing conditions. -
fromJchInViewingConditions(
double J, double C, double h, ViewingConditions viewingConditions) → Cam16 -
Create a CAM16 color from lightness j, chroma
c
, and hueh
, inviewingConditions
. -
fromUcs(
double jstar, double astar, double bstar) → Cam16 -
Create a CAM16 color from CAM16-UCS coordinates
jstar
,astar
,bstar
. assuming the color was viewed in default viewing conditions. -
fromUcsInViewingConditions(
double jstar, double astar, double bstar, ViewingConditions viewingConditions) → Cam16 -
Create a CAM16 color from CAM16-UCS coordinates
jstar
,astar
,bstar
. inviewingConditions
.