import java.applet.*;
import java.awt.*;

public class params extends Scrib{
         // Read  in 2 params and set color
    public void init(){
           super.init();
           Color foreground=getColorParameter("foreground");
           Color background=getColorParameter("background");
            if(foreground != null)this.setForeground(foreground);
            if(background != null)this.setBackground(background);
          } // end init

    // Read the specified parameter interpret as hex and conver to color.
    protected Color getColorParameter(String name){
            String value=this.getParameter(name);
            int intvalue;
             try{ intvalue=Integer.parseInt(value,16);} // end try
             catch(NumberFormatException e){return null;}  // end catch
              
            return new Color(intvalue);
        } // end get Color

          // Share info with program
       public String[][] getParameterInfo(){
                String[][] info={
                 {"foreground","hexidecimal color value","foreground color"},
                 {"background","hexidecimal color value","background color"}
                 };  // end definition of info
           return info;
        } // end get Param info

      public String getAppletInfo(){
            return "Scribble v0.0..2 by David Flanagan";} // end get Applet info

   } // end Param class


