EasyRGB gives the following formula for determining the hue (and chroma) of a CIE L*a*b* color:
var_H = arc_tangent( CIE-b*, CIE-a* ) //Quadrant by signs
if ( var_H > 0 ) var_H = ( var_H / PI ) * 180
else var_H = 360 - ( abs( var_H ) / PI ) * 180
CIE-L* = CIE-L*
CIE-C* = sqrt( CIE-a* ^ 2 + CIE-b* ^ 2 )
CIE-H° = var_H
However, it gives the formula below on this page (used by the Delta CMC algorithm):
CieLab2Hue( var_a, var_b ) //Function returns CIE-H° value
{
var_bias = 0
if ( var_a >= 0 && var_b == 0 ) return 0
if ( var_a < 0 && var_b == 0 ) return 180
if ( var_a == 0 && var_b > 0 ) return 90
if ( var_a == 0 && var_b < 0 ) return 270
if ( var_a > 0 && var_b > 0 ) var_bias = 0
if ( var_a < 0 ) var_bias = 180
if ( var_a > 0 && var_b < 0 ) var_bias = 360
return ( rad2deg( atan( var_b / var_a ) ) + var_bias )
}
To worsen matters, this Wikipedia page states the following:
CIELUV can also be expressed in cylindrical form (CIELCH), with the chromaticity components replaced by correlates of chroma and hue.
One could conclude that this means that CIE L*a*b* should be first converted to CIE L*u*v* before the hue can be determined.
Can anyone shed any light on this?
Convert orthogonal coordinates a, b to polar coordinates C, h
C = sqrt (a * a + b * b)
h = arctan (b/a)
C is the chroma, h is the hue angle.