Hey;
I want to store string, ConsoleColor pairs like
dataStructure.Add(new KeyValuePair<string, ConsoleColor>("Red", ConsoleColor.Red))
I tried List but it did not seem to work;
List<KeyValuePair<string, ConsoleColor>> colorList;
colorList.Add(new KeyValuePair<string, ConsoleColor>("Red", ConsoleColor.Red));
colorList.Add(new KeyValuePair<string, ConsoleColor>("Yellow", ConsoleColor.Yellow));
colorList.Add(new KeyValuePair<string, ConsoleColor>("Green", ConsoleColor.Green));
colorList.Add(new KeyValuePair<string, ConsoleColor>("Blue", ConsoleColor.Blue));
colorList.Add(new KeyValuePair<string, ConsoleColor>("White", ConsoleColor.White));
with the error "An unhandled exception of type 'System.NullReferenceException' occurred in BrainSalad.exe".
Can you help me with this issue?