// GENERATED BY genfields.pl. DO NOT EDIT!
package vrml.field;
import vrml.*;
import java.util.*;

public class SFColor extends Field {
float red,green,blue;
public SFColor(float colors[]) { red = colors[0]; green=colors[1]; blue=colors[2];}
public void setValue(float colors[]) {red = colors[0]; green=colors[1]; blue=colors[2]; value_touched();}
public SFColor() { red=0; green=0; blue=0;}
public SFColor(float r,float g,float b) { red=r; green=g; blue=b;}
public void setValue(float r,float g,float b) {red=r; green=g; blue=b; value_touched();}
public SFColor(String s) throws Exception {
		;
		if(s == null) {
			red=0; green=0; blue=0;; return;
		}
		s = s.trim();
		
   	StringTokenizer tok = new StringTokenizer(s);
	red = 	new Float(tok.nextToken()).floatValue();
	green =	new Float(tok.nextToken()).floatValue();
	blue =	new Float(tok.nextToken()).floatValue();
	
	}public void getValue(float colors[]) {colors[0] = red; colors[1] = green; colors[2] = blue;}
public float getBlue() {return blue;}
public float getGreen() {return green;}
public float getRed() {return red;}
public void setValue(ConstSFColor f) {red = f.getRed(); green = f.getGreen(); blue = f.getBlue(); value_touched();}
		public void setValue(SFColor f) {red = f.getRed(); green = f.getGreen(); blue = f.getBlue(); value_touched(); }
public String toString() {return Float.toString(red) + " " + 
	Float.toString(green) + " " + Float.toString(blue);}public Object clone() {SFColor _x = new SFColor(red,green,blue); return _x;}}