Function Repository Resource:

# ArgHue

Map the argument of a complex number to a color

Contributed by: Ted Ersek
 ResourceFunction["ArgHue"][arg] returns Hue[h,1,1] where h depends on the value of arg. ResourceFunction["ArgHue"][arg,abs] creates a Hue based on the argument arg and magnitude abs of a complex value.

## Details and Options

The parameter arg must be a real number.
The parameter abs must be a real number in the closed interval [0,1].
When using ResourceFunction["ArgHue"] as a ColorFunction, the setting should also be used.
ArgHue takes the following option:
 ZeroColor White approach this color as the parameter abs approaches zero
The setting of the ZeroColor option can be any color.

## Examples

### Basic Examples (2)

When arg is a real number, ArgHue[arg] returns a hue with full saturation and full brightness:

 In[1]:=
 Out[1]=

Display the above colors in a way that indicates the direction in the complex plane they represent:

 In[2]:=
 Out[2]=

Make a color wheel around the origin of the complex plane:

 In[3]:=
 Out[3]=

### Options (5)

#### ZeroColor (5)

When the ZeroColor setting is White, ArgHue[arg,abs] returns a color that approaches White as abs approaches 0:

 In[4]:=
 Out[5]=

When the ZeroColor setting is Black, ArgHue[arg,abs] returns a color that approaches Black as abs approaches 0:

 In[6]:=
 Out[7]=

Specify that White should be used where the function approaches zero:

 In[8]:=
 Out[9]=

Specify that GrayLevel[0.4] should be used where the function approaches zero:

 In[10]:=
 Out[11]=

Specify that RGBColor[1,0.8,0.8] should be used where the function approaches zero:

 In[12]:=
 Out[12]=

### Applications (13)

#### AbsArgPlot (1)

Use ArgHue in the ColorFunction setting of AbsArgPlot:

 In[13]:=
 Out[13]=

#### ComplexPlot (3)

Use ArgHue in the ColorFunction setting of ComplexPlot with the hue indicating the argument of the function value:

 In[14]:=
 Out[14]=

Use ArgHue in the ColorFunction setting of ComplexPlot with the hue indicating the argument of the function value and a color that approaches White as the function value approaches zero:

 In[15]:=
 Out[16]=

Use ArgHue in the ColorFunction setting of ComplexPlot with the hue indicating the argument of the function value and a color that approaches Black as the function value approaches zero:

 In[17]:=
 Out[18]=

#### ComplexPlot3D (3)

Use ArgHue in the ColorFunction setting of ComplexPlot3D with the hue indicating the argument of the function value:

 In[19]:=
 Out[19]=

Use ArgHue in the ColorFunction setting of ComplexPlot3D with the hue indicating the argument of the function value and a color that approaches White as the function value approaches zero:

 In[20]:=
 Out[21]=

Use ArgHue in the ColorFunction setting of ComplexPlot3D with the hue indicating the argument of the function value and a color that approaches Black as the function value approaches zero:

 In[22]:=
 Out[23]=

#### ComplexListPlot (3)

Use ArgHue in the ColorFunction setting of ComplexListPlot with the hue indicating the argument of the function value:

 In[24]:=
 Out[25]=

Use ArgHue in the ColorFunction setting of ComplexListPlot with the hue indicating the argument of the function value and a color that approaches White as the function value approaches zero:

 In[26]:=
 Out[3]=

Use ArgHue in the ColorFunction setting of ComplexListPlot with the hue indicating the argument of the function value and a color that approaches Black as the function value approaches zero:

 In[27]:=
 Out[28]=

#### ComplexArrayPlot (3)

Use ArgHue in the ColorFunction setting in ComplexArrayPlot with the hue indicating the argument of the function value:

 In[29]:=
 Out[30]=

Use ArgHue in the ColorFunction setting of ComplexArrayPlot with the hue indicating the argument of the function value and a color that approaches White as the function value approaches zero:

 In[31]:=
 Out[32]=

Use ArgHue in the ColorFunction setting of ComplexArrayPlot with the hue indicating the argument of the function value and a color that approaches Black as the function value approaches zero:

 In[33]:=
 Out[34]=

### Properties and Relations (1)

ArgHue[h] is periodic with period 2π:

 In[35]:=
 Out[35]=

Ted Ersek

## Version History

• 1.0.0 – 15 February 2023