-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Labels
FeatureNew feature or requestNew feature or requestResearchFurther reading / things to look intoFurther reading / things to look into
Description
Correlated Color Temperature (CCT) (in K)
Returns a correlated color temperature.
Option A:
Based on Bruce Justin Lindbloom's implementation
http://www.brucelindbloom.com/Eqn_XYZ_to_T.html
Option B:
based on McCamy cubic approximation
https://en.wikipedia.org/wiki/Color_temperature
var xyz65_Sum = xyz65.x + xyz65.y + xyz65.z;
if (xyz65_Sum !== 0) {
xyY65.x = xyz65.x / xyz65_Sum;
xyY65.y = xyz65.y / xyz65_Sum;
xyY65.Y = xyz65.y;
} else {
xyY65.x = 0;
xyY65.y = 0;
xyY65.Y = 0;
}
var n = (xyY65.x - 0.3320) / (0.1858 - xyY65.y);
var cct = (449.0 * Math.pow(n, 3)) + (3525.0 * Math.pow(n, 2)) + (6823.3 * n) + 5520.33;
Benefit of option B:
Caculation of xyY coordinates which are actually not covered by culori
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FeatureNew feature or requestNew feature or requestResearchFurther reading / things to look intoFurther reading / things to look into