Esempio n. 1
0
        protected override Palette NewPalette()
        {
            var palette = new CodedPalette();

            palette.ColorAttributesChanged += Palette_ColorAttributesChanged;
            palette.ColorVisibilityChanged += Palette_ColorVisibilityChanged;
            return(palette);
        }
Esempio n. 2
0
 /// <summary>
 /// Returns array of ordered by symbol colors.
 /// </summary>
 /// <param name="palette">Palette with colors to order.</param>
 /// <param name="desc">Order in descending.</param>
 /// <returns>Ordered enumeration of colors.</returns>
 public static IEnumerable <CodedColor> OrderBySymbol(this CodedPalette palette, bool desc = false)
 {
     return(desc ? ((IEnumerable <CodedColor>)palette).OrderByDescending(c => c.SymbolChar) : ((IEnumerable <CodedColor>)palette).OrderBy(c => c.SymbolChar));
 }
Esempio n. 3
0
 /// <summary>
 /// Returns array of ordered by code colors.
 /// </summary>
 /// <param name="palette">Palette with colors to order.</param>
 /// <param name="desc">Order in descending.</param>
 /// <returns>Ordered enumeration of colors.</returns>
 public static IEnumerable <CodedColor> OrderByCode(this CodedPalette palette, bool desc = false)
 {
     return(desc
                         ? ((IEnumerable <CodedColor>)palette).OrderByDescending(c => c.ColorCode, new ColorCodeComparer())
                         : ((IEnumerable <CodedColor>)palette).OrderBy(c => c.ColorCode, new ColorCodeComparer()));
 }