Performance: print each letter of a string in different colors. DO#

I am practicing for my technical interview and I am worried that my code does not meet the standard. What can I do to improve this response?

Here is the question: https://www.careercup.com/question?id=5739126414901248

Dice

colors = [“red”, “blue”, “green”, “yellow”]; and a rope

str = "Lorem ipsum dolor sit amet";

Write a function that prints each letter of the string in different colors. former. L is red, or is blue, r is green, e is yellow, m is red, after space, it should be blue.

My answer:

static empty TestPrintColors ()
{
rope[] colors = new string[4] {"red", "blue", "green", "yellow"};
string str = "Lorem ipsum dolor sit amet";
PrintColors (colors, str);
}

static void PrintColors (string[] colors, string of rope)
{
character registration;
ConsoleColor originalColor = Console.ForegroundColor;
int colorIndex = 0;
ConsoleColor currentColor = originalColor;
for (int i = 0; i < str.Length; i++)
        {
            log = str[i];

            if (log == ' ')
            {
                Console.WriteLine(log);
                continue;
            }

            switch(colors[colorIndex])
            {
                case "red":
                currentColor = ConsoleColor.Red;
                break;

                case "blue":
                currentColor = ConsoleColor.Blue;
                break;

                case "green":
                currentColor = ConsoleColor.Green;
                break;

                case "yellow":
                currentColor = ConsoleColor.Yellow;
                break;

                default:
                currentColor = originalColor;
                break;
            }

            colorIndex++;

            if (colorIndex >= colors.Longitude)
{
colorIndex = 0;
}

Console.ForegroundColor = currentColor;

Console.WriteLine (log);
}

Console.ForegroundColor = originalColor;
}