
package tmcm.xModels;

import java.awt.Color;
import java.util.Vector;


class RGBParam extends SceneMaker {

   protected Color c;
   protected ParamVal r, g, b;
   
   RGBParam(Color c) {
      this.c = c;
   }
   
   RGBParam(ParamVal r, ParamVal g, ParamVal b) {
      this.r = r;
      this.g = g;
      this.b = b;
   }
   
   Color getVal(int frameNumber) {
      if (c == null) {
         double red = r.getVal(frameNumber);
         double green = g.getVal(frameNumber);
         double blue = b.getVal(frameNumber);
         return new Color((float)red, (float)green, (float)blue);
      }
      else
         return c;
   }

   void prepare(PreparedScene scene, int frameNum, Transform T) {
      scene.addColor(getVal(frameNum));
   }

}  // End Class RGBParam


