src/Colourful/Utils/CCTConverter.cs
/// <summary>
/// Returns CCT (specified in K) of given chromaticity.
/// Ranges usually from around 0 to 25000.
/// </summary>
Returns CCT (specified in K) of given chromaticity.
Ranges usually from around 0 to 25000.
Returns CCT ( specified in K ) of given chromaticity . Ranges usually from around 0 to 25000 .
public static double GetCCTOfChromaticity(in xyChromaticity chromaticity)
        {
            const double xe = 0.3366;
            const double ye = 0.1735;
            const double A0 = -949.86315;
            const double A1 = 6253.80338;
            const double t1 = 0.92159;
            const double A2 = 28.70599;
            const double t2 = 0.20039;
            const double A3 = 0.00004;
            const double t3 = 0.07125;
            var n = (chromaticity.x - xe) / (chromaticity.y - ye);
            var cct = A0 + A1 * Exp(-n / t1) + A2 * Exp(-n / t2) + A3 * Exp(-n / t3);
            return cct;
        }
public static double GetCCTOfChromaticity ( in xyChromaticity chromaticity ) { const double xe = 0.3366 ; const double ye = 0.1735 ; const double A0 = - 949.86315 ; const double A1 = 6253.80338 ; const double t1 = 0.92159 ; const double A2 = 28.70599 ; const double t2 = 0.20039 ; const double A3 = 0.00004 ; const double t3 = 0.07125 ; var n = ( chromaticity . x - xe ) / ( chromaticity . y - ye ) ; var cct = A0 + A1 * Exp ( - n / t1 ) + A2 * Exp ( - n / t2 ) + A3 * Exp ( - n / t3 ) ; return cct ; }
Returns CCT (specified in K) of given chromaticity.
Returns CCT ( specified in K ) of given chromaticity .
// approximation described here: http://en.wikipedia.org/wiki/Color_temperature#Approximation
xyChromaticity
in