public xyYColor(xyChromaticityCoordinates chromaticity, double Y) { if (chromaticity == null) throw new ArgumentNullException("chromaticity"); Chromaticity = chromaticity; Luminance = Y; }
public xyYColor(xyChromaticityCoordinates chromaticity, double Y) { if (chromaticity == null) { throw new ArgumentNullException("chromaticity"); } Chromaticity = chromaticity; Luminance = Y; }
public double GetCCTOfChromaticity(xyChromaticityCoordinates chromaticity) { // approximation described here: http://en.wikipedia.org/wiki/Color_temperature#Approximation 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; double n = (chromaticity.x - xe) / (chromaticity.y - ye); double cct = A0 + A1 * Math.Exp(-n / t1) + A2 * Math.Exp(-n / t2) + A3 * Math.Exp(-n / t3); return cct; }
public double GetCCTOfChromaticity(xyChromaticityCoordinates chromaticity) { // approximation described here: http://en.wikipedia.org/wiki/Color_temperature#Approximation 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; double n = (chromaticity.x - xe) / (chromaticity.y - ye); double cct = A0 + A1 * Math.Exp(-n / t1) + A2 * Math.Exp(-n / t2) + A3 * Math.Exp(-n / t3); return(cct); }
/// <inheritdoc cref="object" /> public bool Equals(xyChromaticityCoordinates other) => x.Equals(other.x) && y.Equals(other.y);
/// <param name="chromaticity">Chromaticity coordinates (x and y together)</param> /// <param name="Y">Y (usually from 0 to 1)</param> public xyYColor(xyChromaticityCoordinates chromaticity, double Y) { Chromaticity = chromaticity; Luminance = Y; }
public bool Equals(xyChromaticityCoordinates other) { return _x.Equals(other._x) && _y.Equals(other._y); }
public bool Equals(xyChromaticityCoordinates other) { return(_x.Equals(other._x) && _y.Equals(other._y)); }