A smooth transition between two colors can be created by linearly interpolating the color coordinates. Interpolating between colors CA and CB can be written algebraically as
C(λ) = (1 - λ)CA + λCB, where 0 ≤ λ ≤ 1.
The result will vary depending on the color space used and whether the color is described in Cartesian coordinates or polar coordinates. Polar coordinates describe hue as an angle, so the path between two colors is different from the Cartesian path. This is very noticeable for complementary colors.
The color spaces I have examined are:
All images are encoded with an embedded sRGB ICC profile and should be approximately accurate when viewed on most displays.
sRGB | |
CIE 1931 XYZ | |
HSVsRGB | |
HSVsRGB (Cartesian) | |
HSLsRGB | |
HSLsRGB (Cartesian) | |
HSIsRGB | |
HSIsRGB (Cartesian) | |
CIELAB L*a*b* | |
CIELAB L*Cabhab | |
CIELUV L*u*v* | |
CIELUV L*Cuvhuv | |
RLAB LRaRbR | |
RLAB LRCRhR | |
CIECAM02 JCh | |
CIECAM02 JaCbC |
sRGB | |
CIE 1931 XYZ | |
HSVsRGB | |
HSVsRGB (Cartesian) | |
HSLsRGB | |
HSLsRGB (Cartesian) | |
HSIsRGB | |
HSIsRGB (Cartesian) | |
CIELAB L*a*b* | |
CIELAB L*Cabhab | |
CIELUV L*u*v* | |
CIELUV L*Cuvhuv | |
RLAB LRaRbR | |
RLAB LRCRhR | |
CIECAM02 JCh | |
CIECAM02 JaCbC |
sRGB | |
CIE 1931 XYZ | |
HSVsRGB | |
HSVsRGB (Cartesian) | |
HSLsRGB | |
HSLsRGB (Cartesian) | |
HSIsRGB | |
HSIsRGB (Cartesian) | |
CIELAB L*a*b* | |
CIELAB L*Cabhab | |
CIELUV L*u*v* | |
CIELUV L*Cuvhuv | |
RLAB LRaRbR | |
RLAB LRCRhR | |
CIECAM02 JCh | |
CIECAM02 JaCbC |
I prefer CIELAB L*a*b* as it provides a uniform transition without introducing additional hues. But the circumstances of each specific application has to be considered fully.
© 2024 Mats Mattsson