protected ColorStrategy(Color Background, HslColor Foreground) { _Background = Background; _Foreground = Foreground; _Seed = new Random(DateTime.Now.Second); }
private static double GetTemp2(HslColor ColorHsl) { double Temp2; if (ColorHsl._Luminosity < 0.5) Temp2 = ColorHsl._Luminosity*(1.0 + ColorHsl._Saturation); else Temp2 = ColorHsl._Luminosity + ColorHsl._Saturation - (ColorHsl._Luminosity*ColorHsl._Saturation); return Temp2; }
public VariedForeground(Color Background, HslColor Foreground, Theme TheTheme) : base(Background, Foreground) { /* Dark foreground needed, so Luminosity is reduced to somewhere between 0 & 0.5 * Saturation is full so the color comes out, removing all blackness/greyness * For Light foreground Luminosity is kept between 0.5 & 1 */ _Foreground.Saturation = 1.0; _Range = (TheTheme == Theme.LightBgDarkFg) ? 0d : 0.5; }
public RandomVaried(Color Background, HslColor Foreground, Theme TheTheme) : base(Background, Foreground, TheTheme) { }
public RandomForeground(Color Background, HslColor Foreground) : base(Background, Foreground) { }
public Grayscale(Color Background, HslColor Foreground, Theme TheTheme) : base(Background, Foreground, TheTheme) { /* Saturation is 0 - Meaning no color specified by hue can be seen at all. * So luminance is now reduced to showing grayscale */ _Foreground.Saturation = 0.0; _Background = Color.FromArgb(Background.A, TheTheme == Theme.LightBgDarkFg ? Color.White : Color.Black); }
public FixedForeground(Color Background, HslColor Foreground) : base(Background, Foreground) { }