You can use a noise expression to vary the hair color. In this example, you use an expression to blend the root color with the hair base color set by the XGen hair phenomenon shader.
Click this icon beside the root_color parameter.
In this example, the noise expression is added to the root_color parameter.
In the XGen Expression Editor, click the Samples tab.
Under Samples, click + to expand Global then again to expand Color.
From the expression list that appears, select noiseE.
The noise expression appears in the editor.
In the text field of the XGen Expression Editor, do the following:
At line 10, type:
$baseColor=[1.0,0.0,0.0]; #color
This specifies that the root_color parameter is now used as the Base Color attribute for the expression.
At line 13 after mix($Cs,$Cnew,$Strength), type * $baseColor.
This adds the Base Color value to the noise calculations.
Click the swatch in the XGen Expression Editor to validate the expression.
(Optional) In the Customer Shader Parameters section of the Attribute Editor, use the sliders in the editor to modify the noise pattern in the expression.
For example, set freq_fine to 0.356 and freq_coarse to 8.