Example #1
0
 public static ColorStrategy Get(Theme theme, Style style,
                                 Color background, Color foreground)
 {
     var fgHsl = (theme == Theme.LightBgDarkFg)
                     ? foreground.Darken()
                     : foreground.Lighten();
     if (background.A != 255) /* Not interfering with any transparent color */
         return set[style](background, fgHsl, theme);
     var bgHsl = (theme == Theme.LightBgDarkFg)
                     ? background.Lighten()
                     : background.Darken();
     return set[style]((Color) bgHsl, fgHsl, theme);
 }
 public static ColorStrategy Get(Theme TheTheme, Style TheStyle,
                                 Color Background, Color Foreground)
 {
     var FgHsl = (TheTheme == Theme.LightBgDarkFg)
                     ? Foreground.Darken()
                     : Foreground.Lighten();
     if (Background.A != 255) /* Not interfering with any transparent color */
         return _Set[TheStyle](Background, FgHsl, TheTheme);
     var BgHsl = (TheTheme == Theme.LightBgDarkFg)
                     ? Background.Lighten()
                     : Background.Darken();
     return _Set[TheStyle]((Color) BgHsl, FgHsl, TheTheme);
 }