Exemplo n.º 1
0
        public HighlightBackgroundColorsTable(
            IColorTheme colorTheme
            )
        {
            var numColors = FilterAction.IncludeAndColorizeLast - FilterAction.IncludeAndColorizeFirst + 1;

            if (lightThemeColors.Length != numColors)
            {
                throw new Exception("inconsistent constants");
            }
            colorsSelector = Selectors.Create(
                () => colorTheme.Mode,
                theme => ImmutableArray.CreateRange((
                                                        theme == ColorThemeMode.Light ?
                                                        lightThemeColors
                                  : HSLColorsGenerator.Generate(numHues: numColors, saturation: 0.80, lightness: 0.30)
                                                        ).Select(ColorTableUtils.FromRGB))
                );
        }
Exemplo n.º 2
0
 public LogThreadsColorsTable(
     IColorTheme colorTheme,
     Func <PaletteBrightness> brightnessSelector)
 {
     colorsSelector = Selectors.Create(
         () => colorTheme.Mode,
         brightnessSelector,
         (theme, brightness) =>
     {
         if (theme == ColorThemeMode.Light)
         {
             return(ImmutableArray.CreateRange(lightThemeBaseColors.Select(ColorTableUtils.FromRGB).Select(cl => AdjustLightColor(cl, brightness))));
         }
         else
         {
             return(ImmutableArray.CreateRange(
                        new[] { 0xdcdcdc }
                        .Union(HSLColorsGenerator.Generate(numHues: 16, saturation: 0.45, lightness: 0.65 + GetLightnessCorrection(brightness)))
                        .Select(ColorTableUtils.FromRGB)
                        ));
         }
     }
         );
 }