Esempio n. 1
0
 protected ColorStrategy(Color Background, HslColor Foreground)
 {
     _Background = Background;
     _Foreground = Foreground;
     _Seed = new Random(DateTime.Now.Second);
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 public RandomVaried(Color Background, HslColor Foreground, Theme TheTheme)
     : base(Background, Foreground, TheTheme)
 {
 }
Esempio n. 5
0
 public RandomForeground(Color Background, HslColor Foreground)
     : base(Background, Foreground)
 {
 }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 public FixedForeground(Color Background, HslColor Foreground)
     : base(Background, Foreground)
 {
 }