/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package medusa.georgios;
import java.io.Serializable;
/**
*
* @author Pavlopoulos
*/
public class Color3f implements Serializable {
float x,y,z;
/**
* Constructs and initializes a Color3f to (0,0,0).
*/
public Color3f() {
// super(); called implicitly.
}
/**
* Constructs color from awt.Color.
*
* @param color awt color
*/
public Color3f(float x, float y, float z) {
this.x=x;
this.y=y;
this.z=z;
}
public Color3f(java.awt.Color color) {
x = ((float)color.getRed())/255;
y = ((float)color.getGreen())/255;
z = ((float)color.getBlue())/255;
}
/**
* Sets color from awt.Color.
* @param color awt color
*/
public final void set(java.awt.Color color) {
x = ((float)color.getRed())/255;
y = ((float)color.getGreen())/255;
z = ((float)color.getBlue())/255;
}
/**
* Gets awt.Color.
*
* @return color awt color
*/
public final java.awt.Color get() {
return new java.awt.Color(x, y, z);
}
}
Ads help maintain this website.