public ColourProvider() { var swatches = new SwatchesProvider() .Swatches.Where(s => s.IsAccented).ToArray(); var orders = new Dictionary <string, int>(StringComparer.OrdinalIgnoreCase); _order.Select((str, idx) => new { str, idx }) .ForEach(x => orders[x.str] = x.idx); Hues = swatches .OrderBy(x => orders.Lookup(x.Name).ValueOr(() => 100)) .SelectMany(swatch => { return(swatch.AccentHues.Select(hue => new Hue(swatch.Name, hue.Name, hue.Foreground, hue.Color))); }) .ToArray(); DefaultHighlight = Hues .Last(s => s.Swatch.Equals("amber", StringComparison.OrdinalIgnoreCase)); }
public DisplayText(DisplayText displayText, string text) { Text = text; Highlight = displayText.Highlight; Hue = displayText.Hue; }
public DisplayText(MatchedString matchedString) { Text = matchedString.Part; Highlight = matchedString.IsMatch; Hue = matchedString.Hue; }