namespace Colourful { /// /// Extensions useful for and color spaces. /// internal static class SaturationLChFormulas { /// /// Returns saturation of the color (chroma normalized by lightness) /// public static double GetSaturation(double L, double C) { var result = 100 * (C / L); if (double.IsNaN(result)) return 0; return result; } /// /// Gets chroma from saturation and lightness /// public static double GetChroma(double saturation, double L) { var result = L * (saturation / 100); return result; } } }