DAZ Script |
---|
DzFloatColor () |
DzFloatColor ( String color ) |
DzFloatColor ( Number r, Number g, Number b, Number a=1.0 ) |
DzFloatColor ( Number val, Number alpha=1.0 ) |
DzFloatColor ( Array color ) |
DzFloatColor ( Color color ) |
DzFloatColor ( DzFloatColor color ) |
DAZ Script | |
---|---|
void | clamp ( Number min, Number max, Boolean includeAlpha=false ) |
DzFloatColor | clamped ( Number min, Number max, Boolean includeAlpha=false ) |
DzFloatColor | clampedMax ( Number max, Boolean includeAlpha=false ) |
DzFloatColor | clampedMin ( Number min, Boolean includeAlpha=false ) |
void | clampMax ( Number max, Boolean includeAlpha=false ) |
void | clampMin ( Number min, Boolean includeAlpha=false ) |
Boolean | equals ( DzFloatColor color, Number tolerance=0.000001 ) |
void | gammaColor ( Number gamma=2.2, Boolean doAlpha=false ) |
Color | getColor () |
Number | getGrayscale () |
Array | getHsl () |
Array | getHsv () |
Number | getMaxRGBValue () |
Number | getRelativeLuminance () |
Array | getRgba () |
void | linearizeColor ( Number gamma=2.2, Boolean doAlpha=false ) |
DzFloatColor | modulate ( Number min, Number max, Boolean includeAlpha=false ) |
void | modulo ( Number min, Number max, Boolean includeAlpha=false ) |
void | setHsl ( Number h, Number s, Number l, Number a=1.0 ) |
void | setHsl ( Array list ) |
void | setHsv ( Array list ) |
void | setHsv ( Number h, Number s, Number v, Number a=1.0 ) |
void | setRgba ( Array list ) |
void | setValue ( Number r, Number g, Number b, Number a=1.0 ) |
void | setValue ( Color color ) |
String | toString () |
This class manages 4-component colors (colors that can include an alpha value).
Holds the alpha value for the color. Should be in the [0,1] range.
Holds the blue value for the color. Should be in the [0,1] range.
Holds the green value for the color. Should be in the [0,1] range.
Holds the red value for the color. Should be in the [0,1] range.
Default constructor. Initializes a new color to opaque black.
DzFloatColor( String color )
Creates a floating point color by parsing a string.
Parameter(s):
DzFloatColor( Number r, Number g, Number b, Number a=1.0 )
Constructor that takes individual floating-point RGBA components. Initializes the color to the given values. Values should be in the [0,1] range.
Parameter(s):
Example
var oFloatColor4Arg = new DzFloatColor( 1, 0.5, 0.5, 1 ); print( oFloatColor4Arg ); //[1,0.5,0.5,1]
DzFloatColor( Number val, Number alpha=1.0 )
Constructor that creates an achromatic color.
Parameter(s):
Example
var oFloatColor1Arg = new DzFloatColor( 0.5 ); print( oFloatColor1Arg ); //[0.5,0.5,0.5,1] var oFloatColor2Arg = new DzFloatColor( 0.5, 1 ); print( oFloatColor2Arg ); //[0.5,0.5,0.5,1]
DzFloatColor( Array color )
Constructor that takes a floating-point array to define RGBA colors. Initializes the color to the given values.
Parameter(s):
Example
var oFloatColorArray1Arg = new DzFloatColor( [ 1 ] ); print( oFloatColorArray1Arg ); //[1,1,1,1] var oFloatColorArray2Arg = new DzFloatColor( [ 0.5, 1 ] ); print( oFloatColorArray2Arg ); //[0.5,0.5,0.5,1] var oFloatColorArray3Arg = new DzFloatColor( [ 1, 0.5, 0.25 ] ); print( oFloatColorArray3Arg ); //[1,0.5,0.25,1] var oFloatColorArray4Arg = new DzFloatColor( [ 1, 0.5, 0.25, 1 ] ); print( oFloatColorArray4Arg ); //[1,0.5,0.25,1]
DzFloatColor( Color color )
Constructor that takes a QColor. Initializes the color to the given color. The color is assumed to be completely opaque.
Parameter(s):
Example
var oColor = new Color( 255, 128, 0 ); var oFloatColorCopyColor = new DzFloatColor( oColor ); print( oFloatColorCopyColor ); //[1,0.501961,0,1]
DzFloatColor( DzFloatColor color )
Copy Constructor.
Parameter(s):
Example
var oColor = new Color( 255, 128, 0 ); var oFloatColorCopyColor = new DzFloatColor( oColor ); print( oFloatColorCopyColor ); //[1,0.501961,0,1] var oFloatColorCopyFloatColor = new DzFloatColor( oFloatColorCopyColor ); print( oFloatColorCopyFloatColor ); //[1,0.501961,0,1]
void : clamp( Number min, Number max, Boolean includeAlpha=false )
Modifies the color such that the value of no component is less than min
and no more than max
.
Parameter(s):
true
, the alpha component is also clamped.DzFloatColor : clamped( Number min, Number max, Boolean includeAlpha=false )
Parameter(s):
true
, the alpha component is also clamped.Return Value:
min
and no more than max
.DzFloatColor : clampedMax( Number max, Boolean includeAlpha=false )
Parameter(s):
true
, the alpha component is also clamped.Return Value:
max
.DzFloatColor : clampedMin( Number min, Boolean includeAlpha=false )
Parameter(s):
true
, the alpha component is also clamped.Return Value:
min
.void : clampMax( Number max, Boolean includeAlpha=false )
Modifies the color such that the value of no component is more than max
.
Parameter(s):
true
, the alpha component is also clamped.void : clampMin( Number min, Boolean includeAlpha=false )
Modifies the color such that the value of no component is less than min
.
Parameter(s):
true
, the alpha component is also clamped.Boolean : equals( DzFloatColor color, Number tolerance=0.000001 )
Parameter(s):
Return Value:
true
if this color is within tolerance
of color
, otherwise false
.void : gammaColor( Number gamma=2.2, Boolean doAlpha=false )
Applies a gamma value to the color.
Parameter(s):
true
, applies gamma
to the alpha channel of the color.Return Value:
Number : getGrayscale()
Return Value:
Return Value:
Return Value:
Number : getMaxRGBValue()
Return Value:
Number : getRelativeLuminance()
Return Value:
Return Value:
void : linearizeColor( Number gamma=2.2, Boolean doAlpha=false )
Linerizes the color based on a gamma value.
Parameter(s):
true
, linearizes the alpha channel of the color by gamma
.DzFloatColor : modulate( Number min, Number max, Boolean includeAlpha=false )
Parameter(s):
true
, the alpha component is also clamped.Return Value:
min
and max
.void : modulo( Number min, Number max, Boolean includeAlpha=false )
Modifies the color such that the value of each component is modulated between min
and max
.
Parameter(s):
true
, the alpha component is also modulated.void : setHsl( Number h, Number s, Number l, Number a=1.0 )
Sets a HSL value on the color.
Parameter(s):
Sets the color according to an array of the hue, saturation, lightness and (optionally) alpha component values.
Sets the color according to an array of the hue, saturation, value and alpha component values.
void : setHsv( Number h, Number s, Number v, Number a=1.0 )
Sets a HSV value on the color.
Parameter(s):
Sets the color according to an array of the red, green, blue and alpha component values.
void : setValue( Number r, Number g, Number b, Number a=1.0 )
Sets the color values. Values should be in the [0,1] range.
Parameter(s):
See Also:
void : setValue( Color color )
Sets the color.
Parameter(s):
Return Value: