instantreality 1.0

SFColor

The SFColor object corresponds to a X3D SFColor field.

The properties of the object can be accessed via the r, g and b property as well as by the indices [0] for red, [1] for green and [2] blue.

Properties

TypePropertyDescriptionStandard
numberr

The red component of the colour [read/write].

X3D2.0
numberg

The green component of the colour [read/write].

X3D2.0
numberb

The blue component of the colour [read/write].

X3D2.0

Functions

Return typeFunctionDescriptionStandard
SFColor(number r, number g, number b)

Constructs a new SFColor object initialized to the values of r, g and b.

r, g, and b are the red, green, and blue values of the colour. Missing values default to 0.0.

voidsetHSV(number h, number s, number v)

Sets the value of the colour by specifying the values of hue, saturation, and value.

X3D2.0
ArraygetHSV()

Returns the value of the colour in a 3 element numeric array, with hue at index 0, saturation at index 1, and value at index 2.

X3D2.0
StringtoString()

Returns a String containing the value of r, g and b encoded using the Classic VRML encoding (see part 2 of ISO/IEC 19776).

X3D2.0