class datagen.api.assets.HairColor(*, melanin: ConstrainedFloatValue = 0.2, redness: ConstrainedFloatValue = 0.2, whiteness: ConstrainedFloatValue = 0.25, roughness: ConstrainedFloatValue = 0.15, index_of_refraction: ConstrainedFloatValue = 1.4)#

The set of controls that determine the color of hair. This can be applied to any type of hair: regular hair, facial hair, or eyebrows.

index_of_refraction: float#

Defines how the hair bends light that is traveling through it.

All hair is at least somewhat translucent, lighter hair in particular. This setting simulates the changes in the direction of light rays as they travel through the hair, which is an important part of making hair look realistic.

Min: 1.4

Max: 1.65

melanin: float#

Together with redness, defines the base color of the hairs.

This control sets the amount of black in the strands of hair.

Min: 0 - fully white hair

Max: 1 - fully black hair

redness: float#

Together with melanin, defines the base color of the hairs.

This control sets the amount of red in the strands of hair. Redness is primarily noticeable when there is a medium amount of melanin in the hair. When melanin is close to 0 or 1, redness has little or no effect.

Min: 0 - no redness in the hair

Max: 1 - maximum redness in the hair

roughness: float#

Defines the reflectivity of the hair. The rougher the surface of the hair, the more light gets absorbed within it and gets reflected as diffuse light rather than mirror-like reflections.

Min: 0.15 - dull or matte hair

Max: 0.5 - shiny and reflective hair

whiteness: float#

Defines how much the hair has greyed or whitened. The amount of greying is not strictly linear, but it is still useful to think of this value as whitening the hair roughly in percentage terms. As a rule, values between 0.4 and 0.7 generate greying hair, while values above 0.7 generate white hair.

Min: 0 - no whitening or greying in the hair

Max: 1 - the hair has gone fully white