public ColorWay(Color fg, Color bg) { Foreground = new ColorComp(fg); Background = new ColorComp(bg); if (Background.ContrastPen.Color.R == 0) { // light bg Bright = new ColorComp(ColorUtilities.Brighten(fg, -0.6)); // super high contrast High = interpolateToGray(fg, bg, 0.35); //closest to FG Medium = interpolateToGray(fg, bg, 0.70); Low = interpolateToGray(fg, bg, 0.85); VLow = interpolateToGray(fg, bg, 0.95); } else { // dark bg Bright = new ColorComp(ColorUtilities.Brighten(fg, 0.60)); High = interpolateToGray(fg, bg, 0.25);//closest to FG Medium = interpolateToGray(fg, bg, 0.60); Low = interpolateToGray(fg, bg, 0.75); VLow = interpolateToGray(fg, bg, 0.85); } }