private Color[] GenerateNiceColors(int count) { Color[] arr = new Color[count]; Color baseColor = ColorTranslator.FromHtml("#8A56E2"); double baseHue = (new HSLColor(baseColor)).Hue; List<Color> colorList = new List<Color>(); colorList.Add(baseColor); double step = (240.0 / (double)count); for (int i=1; i < count; i++) { HSLColor nextColor = new HSLColor(baseColor); nextColor.Hue = (baseHue + step * ((double)i)) % 240.0; colorList.Add((Color)nextColor); } return colorList.ToArray(); }
private static double GetTemp2(HSLColor hslColor) { double temp2; if (hslColor.luminosity < 0.5) //<=?? temp2 = hslColor.luminosity * (1.0 + hslColor.saturation); else temp2 = hslColor.luminosity + hslColor.saturation - (hslColor.luminosity * hslColor.saturation); return temp2; }