colour.temperature.xy_to_CCT_Kang2002#
- colour.temperature.xy_to_CCT_Kang2002(xy: ArrayLike, optimisation_kwargs: dict | None = None) NDArrayFloat[source]#
Compute the correlated colour temperature \(T_{cp}\) from the specified CIE xy chromaticity coordinates using Kang et al. (2002) method.
- Parameters:
xy (ArrayLike) – CIE xy chromaticity coordinates.
optimisation_kwargs (dict | None) – Inversion parameters forwarded to
colour.temperature.x0_CCT_grid()andcolour.temperature.solve_CCT_Newton(). Accepted keys aresamples(grid density for the initial guess, defaultcolour.temperature.CCT_INVERSION_GRID_SAMPLES),newton_iterations,backtrack_iterationsandtolerance(forwarded tosolve_CCT_Newton()).
- Returns:
Correlated colour temperature \(T_{cp}\).
- Return type:
Warning
The Kang et al. (2002) method does not provide an analytical inverse transformation to compute the correlated colour temperature \(T_{cp}\) from the specified CIE xy chromaticity coordinates. The current implementation relies on a damped Gauss-Newton iteration seeded by nearest-neighbour lookup against a coarse grid sampled from the analytical forward over the [1667, 25000] domain. The lookup keeps the iteration in the correct basin near the domain edges where the polynomial is non-monotonic if extrapolated.
References
[KMH+02]
Examples
>>> xy_to_CCT_Kang2002([0.31342600, 0.32359597]) np.float64(6504.389303...)