Package vrml.field
Class SFColor
java.lang.Object
vrml.Field
vrml.field.SFColor
-
Field Summary
FieldsFields inherited from class vrml.Field
valueChanged
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Create a cloned copy of this node.float
getBlue()
Get the blue component of the colorfloat
getGreen()
Get the green component of the colorfloat
getRed()
Get the red component of the colorvoid
getValue
(float[] colors) Copy this angle into the user arrayvoid
setValue
(float[] colors) Set the field to the new value based on the user datavoid
setValue
(float red, float green, float blue) Set the field to the new components.void
setValue
(ConstSFColor color) Set this field to the values from the passed in fieldvoid
Set this field to the values from the passed in fieldtoString()
Create a string representation of this field.
-
Field Details
-
data
protected float[] dataThe components of the field
-
-
Constructor Details
-
SFColor
public SFColor()Create a new default color with the fields set to 0 0 0 -
SFColor
public SFColor(float red, float green, float blue) Create a new color based on the given values.- Parameters:
red
- The red component of the colorgreen
- The green component of the colorblue
- The blue component of the color
-
-
Method Details
-
getValue
public void getValue(float[] colors) Copy this angle into the user array- Parameters:
colors
- The target array to copy into
-
getRed
public float getRed()Get the red component of the color- Returns:
- The red value [0 - 1]
-
getGreen
public float getGreen()Get the green component of the color- Returns:
- The green value [0 - 1]
-
getBlue
public float getBlue()Get the blue component of the color- Returns:
- The blue value [0 - 1]
-
setValue
public void setValue(float[] colors) Set the field to the new value based on the user data- Parameters:
colors
- The new data to copy
-
setValue
public void setValue(float red, float green, float blue) Set the field to the new components.- Parameters:
red
- The red component of the colorgreen
- The green component of the colorblue
- The blue component of the color
-
setValue
Set this field to the values from the passed in field- Parameters:
color
- The field to copy the values from
-
setValue
Set this field to the values from the passed in field- Parameters:
color
- The field to copy the values from
-
toString
-
clone
-