Exemple #1
0
        static void writeConsoleOutput()
        {
            string s;

            while ((s = Console.ReadLine()) != null)
            {
                Console.Write(Colorize.Rainbow(s, cparam));
                Console.WriteLine("\u001b[0m"); // set color back to normal
            }
            return;
        }
Exemple #2
0
        static void ParseArgs(string[] args)
        {
            bool show_help = false;

            var p = new OptionSet()
            {
                { "?|h|help", "Show this message and exit",
                  v => show_help = v != null },
                { "p=|pallete=", "Choose color pallete range\n" +
                  "1 - Light Pastel\n" +
                  "2 - Dark Pastel\n" +
                  "3 - Light Gray",
                  (int v) => Colorize.SetColorPalleteRange(v, cparam) },
            };

            List <string> extra;

            try
            {
                extra = p.Parse(args);
            }
            catch (OptionException e)
            {
                Console.Write("rgbarf: ");
                Console.WriteLine(e.Message);
                Console.WriteLine("Try `rgbarf --help' for more information.");
                return;
            }

            if (show_help)
            {
                ShowHelp(p);
                return;
            }

            return;
        }