public VariedForeground(Color background, HslColor foreground, Theme theme) : 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 = (theme == Theme.LightBgDarkFg) ? 0d : 0.5; }
public RandomForeground(Color background, HslColor foreground) : base(background, foreground) { }
protected ColorStrategy(Color background, HslColor foreground) { Background = background; Foreground = foreground; Seed = new Random(DateTime.Now.Second); }
public FixedForeground(Color background, HslColor foreground) : base(background, foreground) { }
public RandomVaried(Color background, HslColor foreground, Theme theme) : base(background, foreground, theme) { }
public Grayscale(Color background, HslColor foreground, Theme theme) : base(background, foreground, theme) { /* 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, theme == Theme.LightBgDarkFg ? Color.White : Color.Black); }
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 RandomForeground(Color background, HslColor foreground) : base(background, foreground) { }
public FixedForeground(Color background, HslColor foreground) : base(background, foreground) { }
protected ColorStrategy(Color background, HslColor foreground) { Background = background; Foreground = foreground; Seed = new Random(DateTime.Now.Second); }
public RandomVaried(Color background, HslColor foreground, Theme theme) : base(background, foreground, theme) { }