   import java.awt.Color;
   import java.io.*;
   import java.util.Scanner;


/**
 * A class that can be used to retrieve Color objects
 * by name (using the W3C names defined in
 * http://www.w3.org/TR/2003/CR-css3-color-20030514/ )
 */
    public class ColorFinderDebug
   {
      private Color[]        colors;       
      private String[]       names;
   
    /**
     * Default Constructor
     */
       public ColorFinderDebug() throws IOException
      {
         Color          value;       
         int            blue, green, red;       
         Scanner        in;
         String         key;
       
       
         colors = new Color[147];
         names  = new String[147];
       
         in = new Scanner(new File("colors.txt"));
      
         for (int i=0; in.hasNext(); i++)
         {
            key       = in.next();
            red       = in.nextInt();
            green     = in.nextInt();
            blue      = in.nextInt();
            value     = new Color(red, green, blue);          
         
            names[i]  = key;
            colors[i] = value;          
         }
      }
   
   
    /**
     * Get the Color with the given name/description
     *
     * @param   description  The name/description of the Color
     * @return               The Color (or null if no such name exists)
     */
       public Color getColor(String description)
      {
         Color           result;
      
      // Add your code here
         int i;
         boolean found;
         i = 0;
         found = false;
         result = null;
      
         while (!found && i < names.length)  // OR  (!found && i < 147)
         {
            System.out.println (description);
         	System.out.println (names[i]);
            if (description.equals(names[i]))
            { 
               result = colors[i];
               found = true;
               
            }
            	 // end if
            else
               result = null;     
               
           i++; 
         }// end while
         return result;    
      }// end getColor
   }// end class