private static Color PositionToColor(Point position, double imageWidth, double imageHeight) { int h = (int)(position.X * maxH / imageWidth); double v = (imageHeight - position.Y) * maxV / imageHeight; HSL hsl = new HSL(h, maxS, v / 100d); Color color = hsl.ToColor(); return(Color.FromArgb(color.A, color.R, color.G, color.B)); }
public static System.Windows.Media.Color FromHSL(int h, double s, double l) { HSL hsl = new HSL(h, s, l); return(hsl.ToColor()); }