Type: Color

From Waltz
Jump to navigation Jump to search

The Color type represents an RGB color that can be used by various nodes. The colors are defined in the sRGB Color Space. Colors without alpha defined will have an implicit alpha value of 255.

Constructors

Arguments
Color(hex) String hex - A string representing a color in hexadecimal.
Color(r, g, b) Number r - Amount of red in the color between 0 and 255.

Number g - Amount of green in the color between 0 and 255.

Number b - Amount of blue in the color between 0 and 255.

Color(r, g, b, a) Number r - Amount of red in the color between 0 and 255.

Number g - Amount of green in the color between 0 and 255.

Number b - Amount of blue in the color between 0 and 255.

Number a - Amount of alpha in the color between 0 and 255, where 0 is fully transparent and 255 is fully opaque.

FloatColor(r, g, b) Number r - Amount of red in the color between 0.0 and 1.0.

Number g - Amount of green in the color between 0.0 and 1.0.

Number b - Amount of blue in the color between 0.0 and 1.0.

FloatColor(r, g, b, a) Number r - Amount of red in the color between 0.0 and 1.0.

Number g - Amount of green in the color between 0.0 and 1.0.

Number b - Amount of blue in the color between 0.0 and 1.0.

Number a - Amount of alpha in the color between 0.0 and 1.0, where 0.0 is fully transparent and 1.0 is fully opaque.

HSBColor(h, s, b) Number h - Hue angle of the color. This can be any floating-point number. The floor of this number is subtracted from it to create a fraction between 0.0 and 1.0. This fractional number is then multiplied by 360 to produce the hue angle in the HSB color model.

Number s - Amount of saturation between 0.0 and 1.0.

Number b - Amount of brightness between 0.0 and 1.0.

HSBColor(h, s, b, a) Number h - Hue angle of the color. This can be any floating-point number. The floor of this number is subtracted from it to create a fraction between 0.0 and 1.0. This fractional number is then multiplied by 360 to produce the hue angle in the HSB color model.

Number s - Amount of saturation between 0.0 and 1.0.

Number b - Amount of brightness between 0.0 and 1.0.

Number a - Amount of alpha in the color between 0.0 and 1.0, where 0.0 is fully transparent and 1.0 is fully opaque.

Parameters

Type Details
alpha Number Note: The parameter is read-only. The alpha channel of the color between 0 and 255.
blue Number Note: The parameter is read-only. The blue channel of the color between 0 and 255.
green Number Note: The parameter is read-only. The green channel of the color between 0 and 255.
red Number Note: The parameter is read-only. The red channel of the color between 0 and 255.

Functions

Arguments Returns Details
brighter() Color Creates a new Color that is a brighter version of this Color. This method applies an arbitrary scale factor to each of the three RGB components of this Color to create a brighter version of this Color. The alpha value is preserved. Although brighter() and darker() are inverse operations, the results of a series of invocations of these two methods might be inconsistent because of rounding errors.
darker() Color Creates a new Color that is a darker version of this Color. This method applies an arbitrary scale factor to each of the three RGB components of this Color to create a darker version of this Color. The alpha value is preserved. Although brighter() and darker() are inverse operations, the results of a series of invocations of these two methods might be inconsistent because of rounding errors.
equals(c) Color c - A color against which to compare equality. Boolean Compares two colors to determine if they represent the exact same color, including alpha.
Types
Primitives Boolean · Number · String
Objects Color · Dimension · DmxMultiverse · DmxUniverse · LocalInterface · Material · Point · RemoteAddress/IP · Scene · Time · Touch
Node Specific NdiSource · WoControlCue · WoHitTestResult · WoTimeline
Collections List · List of Lists · Map · Varargs
Special Any · Consumer · Expression · Null · Void