Package com.openinventor.inventor
Class SbColorRGBA
- java.lang.Object
-
- com.openinventor.inventor.SbBasic
-
- com.openinventor.inventor.SbVec4f
-
- com.openinventor.inventor.SbColorRGBA
-
public class SbColorRGBA extends SbVec4f
ColorRGBA vector class. This class is used to represent an RGBA color. Each component of the vector is a floating-point number between 0.0 and 1.0. RGBA stands for red, green, blue and alpha. Alpha is the inverse of "transparency", in other words 0 is fully transparent and 1 is fully opaque.Values may be specified in the HSV (hue, saturation and value) color space, but are stored internally as RGBA values.
-
-
Constructor Summary
Constructors Constructor Description SbColorRGBA()
Default constructor.SbColorRGBA(float[] components)
SbColorRGBA(float r, float g, float b, float a)
Constructor that takes an RGBA value as 4 floats.SbColorRGBA(int orderedRGBA)
Constructor that takes an RGBA value as a packed color.SbColorRGBA(SbColorRGBA copyFrom)
SbColorRGBA(SbVec4f vec4f)
Constructor that takes an RGBA vector value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]
getHSVAValue()
Returns color value in the HSV (hue, saturation and value) plus Alpha color space.int
getPackedValue()
Returns an RGBA packed color value, derived from the color vector.float[]
getValue()
SbColorRGBA
setHSVAValue(float[] hsva)
Sets value of color vector from an HSV (Hue, Saturation, and Value) plus Alpha color value.SbColorRGBA
setHSVAValue(float h, float s, float v, float a)
Sets value of color vector from an HSV (Hue, Saturation, and Value) plus Alpha color value.SbColorRGBA
setPackedValue(int orderedRGBA)
Sets value of color vector from an RGBA packed color value.SbColorRGBA
setValue(float[] components)
SbColorRGBA
setValue(float[] components, int startIndex)
void
setValue(SbColorRGBA copyFrom)
static SbColorRGBA[]
toArray(long nativeArray, long length)
-
-
-
Constructor Detail
-
SbColorRGBA
public SbColorRGBA(SbColorRGBA copyFrom)
-
SbColorRGBA
public SbColorRGBA(float[] components)
-
SbColorRGBA
public SbColorRGBA()
Default constructor. The color value is not initialized.
-
SbColorRGBA
public SbColorRGBA(SbVec4f vec4f)
Constructor that takes an RGBA vector value.
-
SbColorRGBA
public SbColorRGBA(float r, float g, float b, float a)
Constructor that takes an RGBA value as 4 floats.
-
SbColorRGBA
public SbColorRGBA(int orderedRGBA)
Constructor that takes an RGBA value as a packed color.
-
-
Method Detail
-
setValue
public SbColorRGBA setValue(float[] components, int startIndex)
-
setValue
public SbColorRGBA setValue(float[] components)
-
setValue
public void setValue(SbColorRGBA copyFrom)
-
getPackedValue
public int getPackedValue()
Returns an RGBA packed color value, derived from the color vector. The packed color format expressed in hexadecimal is 0xrrggbbaa.
-
toArray
public static SbColorRGBA[] toArray(long nativeArray, long length)
-
setPackedValue
public SbColorRGBA setPackedValue(int orderedRGBA)
Sets value of color vector from an RGBA packed color value. The packed color format expressed in hexadecimal is 0xrrggbbaa, where- rr is the red value
- gg is the green value
- bb is the blue value
- aa is the alpha value
RGBA component values range from 0 to 0xFF (255).
-
getHSVAValue
public float[] getHSVAValue()
Returns color value in the HSV (hue, saturation and value) plus Alpha color space.
-
setHSVAValue
public SbColorRGBA setHSVAValue(float h, float s, float v, float a)
Sets value of color vector from an HSV (Hue, Saturation, and Value) plus Alpha color value. All components must be in the range 0 to 1.Value is the same as brightness of the color.
-
setHSVAValue
public SbColorRGBA setHSVAValue(float[] hsva)
Sets value of color vector from an HSV (Hue, Saturation, and Value) plus Alpha color value. All components must be in the range 0 to 1.
-
-