示例#1
0
        protected void RenderWord2(int index, int item, int longestName)
        {
            Console.BackgroundColor = conf.BackColor;
            string word = ColorInfo.GetColorName(index);

            if (index == item)
            {
                Console.ForegroundColor = conf.PromptColor;
                Console.Write("[");
                Console.ForegroundColor = conf.HelpColor;
                Console.Write(word);
                Console.ForegroundColor = conf.PromptColor;
                Console.Write("]");
            }
            else
            {
                Console.ForegroundColor = conf.HelpColor;
                Console.Write($" {word} ");
            }
            string arrow = "";

            arrow  = arrow.PadRight(longestName - word.Length, '-');
            arrow += "->";
            Console.Write(arrow);
            Console.BackgroundColor = ColorInfo.GetColor(index);
            Console.ForegroundColor = ColorInfo.IsDarkColor(index) ? ConsoleColor.White : ConsoleColor.Black;
            Console.WriteLine("  (color looks like this)  ");
        }
示例#2
0
        protected void RenderList2(int item)
        {
            Console.BackgroundColor = conf.BackColor;
            Console.Clear();
            int longest = 0;

            for (int i = 0; i < ColorInfo.NumColors; ++i)
            {
                longest = Math.Max(longest, ColorInfo.GetColorName(i).Length);
            }
            for (int i = 0; i < ColorInfo.NumColors; ++i)
            {
                RenderWord2(i, item, longest);
            }
        }