public static TriadicColorScheme FromColor(ColorRGB color) { var hsl = ColorHSL.FromColor(color); var divisor = 1d / 3d; hsl.H -= divisor; var swatches = new Swatch[] { new Swatch(TertiaryColorID, ColorHSL.Empty), new Swatch(PrimaryColorID, ColorHSL.Empty), new Swatch(SecondaryColorID, ColorHSL.Empty) }; for (var i = 0; i < swatches.Length; i++) { swatches[i].Color = hsl.ToRgb(); hsl.H += divisor; } return(new TriadicColorScheme(swatches)); }