import java.awt.*;

/*
 * Class to translate string colour names to Color values. 
 
 * YOU WILL USE THIS CLASS.  
 * THERE IS NO NEED FOR YOU TO MODIFY THIS CLASS.
 */

 
public class ColourIndex {

    private final static String[] NAME = {"green", "blue", "purple", "red", "orange", "yellow"};
    private final static Color[] VALUE = {Color.green, Color.blue, Color.magenta, Color.red, Color.orange, Color.yellow};
    
    /*
     * Returns a Color corresponding to the String value provided.
     * If there is no match found the Color black is returned.
     
     * @param  input  String contains a colour name.
     * @return  Color value corresponding to the parameter.
     */
     
    public static Color findColor(String input) {
    
       for(int i = 0; i<NAME.length; i++) {
           if(input.equals(NAME[i]))
               return VALUE[i];
       }
       return Color.black;
    }
}