User Tools

Site Tools


Color

DAZScript wrapper for QColor.

More...

Inherits :

Properties

Constructors

DAZ Script
Color ()
Color ( String colorName )
Color ( Number r, Number g, Number b, Number a=255 )
Color ( Color color )

Methods

DAZ Script
Colordark ()
BooleanisValid ()
Colorlight ()
voidsetRgb ( Number r, Number g, Number b, Number a )
voidsetRgb ( Number r, Number g, Number b )
voidsetRgb ( Number colorCode )

Detailed Description

This is the DAZScript counterpart to the QColor type used in the DAZ Studio SDK.

Attention:

  • Inheritance will change to Object in a pending update.

Properties


Number : alpha

The alpha component of the color. In the range 0 to 255.


Number : blue

The blue component of the color. In the range 0 to 255.


Number : green

The green component of the color. In the range 0 to 255.


Number : hue

The hue of the color as defined in the HSV color model.


String : name

The name of the color if it matches a named color, otherwise an empty string.


Number : red

The red component of the color. In the range 0 to 255.


Number : rgb

The color code of the color.


Number : saturation

The saturation of the color as defined in the HSV color model.


Number : value

The value of the color as defined in the HSV color model.

Constructors


Color()

Default Constructor.


Color( String colorName )

Sets the RGB value from colorName, which may be in one of these formats (each of R, G and B is a single hex digit):

  • #RGB
  • #RRGGBB
  • #RRRGGGBBB
  • #RRRRGGGGBBBB
  • A name from the color database

The color is invalid if name cannot be parsed.

Parameter(s):

  • colorName - The named color to set the value of this color to.

Color( Number r, Number g, Number b, Number a=255 )

Component-wise constructor. Each value (i.e., r, g, b, a ) should be in the [0, 255] range.

Parameter(s):

  • r - The red value for the color.
  • g - The green value for the color.
  • b - The blue value for the color.
  • a - The alpha value for the color (since 4.9.4.4).

Color( Color color )

Copy Constructor.

Parameter(s):

  • color - The Color to copy.

Methods


Color : dark()

Return Value:

  • A darker version of this color.

Boolean : isValid()

Return Value:

  • true if the color is valid, otherwise false.

Since:

  • 4.8.1.93

Color : light()

Return Value:

  • A lighter version of this color.

void : setRgb( Number r, Number g, Number b, Number a )

Sets the red, green, blue and alpha values of this color to r, g, b and a, respectively.

Parameter(s):

  • r - The new red value for the color.
  • g - The new green value for the color.
  • b - The new blue value for the color.
  • b - The new alpha value for the color.

void : setRgb( Number r, Number g, Number b )

Sets the red, green and blue values of this color to r, g and b, respectively.

Parameter(s):

  • r - The new red value for the color.
  • g - The new green value for the color.
  • b - The new blue value for the color.

void : setRgb( Number colorCode )

Sets the color code of the color. The value is a bitmask on the form 0xRRGGBB, where RR=red, GG=green, and BB=blue, all as hexadecimal digits.

Parameter(s):

  • colorCode - The encoded value for the color.