Class SFColor

All Implemented Interfaces:
SFColor, X3DField

public class SFColor extends X3DConcreteField implements SFColor
This utility class provides a concrete implementation corresponding to SFColor X3D field type.


Note that SFColor provides a variety of color constants.

Package hint: This specification class is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI). SFColor specifies one RGB (red-green-blue) color triple, where each color value is an RGB triple of floating point numbers in range [0,1]. The default value of an uninitialized SFColor field is (0 0 0). Warning: comma characters within singleton values do not pass strict XML validation.

Related field object: MFColor
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static final float[]
    Default value for this field type is 0 0 0.
    static final String
    Default string value for this field type is "0 0 0".
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static final String
    String constant NAME provides name of this element: SFColor
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static final Pattern
    Precompiled regular expression (regex) pattern for this field type using default REGEX value.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static final String
    Default regular expression (regex) pattern for this field type is \s*(([+]?
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static final int
    Default tuple size for this field type is 3 (i.e. number of component values making up a single-field SF object).
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.
    static float[]
    Color value alias.

    Fields inherited from class org.web3d.x3d.jsail.fields.X3DConcreteField

    validationResult
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for SFColor performs value initialization.
    SFColor(double[] newValue)
    Utility constructor for SFColor using an alternatively typed Java double[] array as new initial value.
    SFColor(double red, double green, double blue)
    Constructor using individual double types as new initial value (which must pass validation checks).
    SFColor(float[] newValue)
    Constructor for SFColor using a corresponding Java primitive float[] array as new initial value.
    SFColor(float red, float green, float blue)
    Constructor using individual float types as new initial value (which must pass validation checks).
    SFColor(int hexColorValue)
    Constructor using single HTML-style 0xRRGGBB hex value as new initial value.
    SFColor(SFColor newValue)
    Constructor to copy an SFColor value as initial value for this new field object.
  • Method Summary

    Modifier and Type
    Method
    Description
    Complement all color values in RGB space (i.e. subtract each component from 1).
    boolean
    equals(SFColor comparisonSFColor)
    Determine whether two objects contain equal values.
    float[]
    Provides current value of the field as a Java primitive type.
    void
    getValue(float[] valueDestination)
    Get the current value of this SFColor by copying it into the valueDestination array, leaving the current object unchanged.
    final void
    Initialization for SFColor applies default initial value.
    static final boolean
    Whether or not this field type is an array (false)
    boolean
    Determine whether current value matches DEFAULT_VALUE
    final boolean
    Test PATTERN match via regular expression (regex) check of current object's toString() value.
    static final boolean
    matches(String value)
    Test PATTERN match with regular expression (regex) of provided value.
    Ensure all component color values are within range [0-1] by clipping as necessary.
    scaleRGB(float scaleFactor)
    Scale all color values in RGB space.
    setValue(double[] newValue)
    Assign a new value to this field.
    setValue(double red, double green, double blue)
    Assign a new value to this field.
    void
    setValue(float[] newValue)
    Assign a new value to this field.
    setValue(float red, float green, float blue)
    Assign a new value to this field.
    setValue(int hexColorValue)
    Public utility accessor method setting single HTML-style 0xRRGGBB hex value as new value.
    setValue(SFColor newValue)
    Apply an SFColor value to this field.
    setValueArray(float[] newValue)
    Assign a new array value to this field, pipelined.
    Utility accessor for SFColor using String value (which must pass parsing validation checks).
    float[]
    Provide float array for this field type.
    static float[]
    toFloatArray(int hexColorValue)
    Public utility method converting single HTML-style 0xRRGGBB hex value to three-tuple float array.
    Provides current value as a String.
    static String
    toString(float[] value)
    Static utility method to provide String representation of a correctly typed input value.
    Provide CSS color value for this object.
    static String
    toStringCSS(float[] colors)
    Provide CSS color value foran RGB triplet.
    static String
    toStringCSS(float red, float green, float blue)
    Provide CSS color value for RGB values.
    Provide HTML color value for this object.
    static String
    toStringHTML(float[] colors)
    Provide HTML color value for an RGB triplet.
    static String
    toStringHTML(float red, float green, float blue)
    Provide HTML color value for RGB values.
    final String
    Validate current value via get/set comparison tests
    final String
    Validate current value via regular expression (regex) check of current object's toString() value, reporting errors only if found.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait