freealg.visualization.domain_coloring#

freealg.visualization.domain_coloring(c, shift=0.0, thresh=inf, n_mod=12.0, n_ph=12.0, vmin=0.35, vmax=1.0, tile_gamma=1.0, tile_mix=0.0)#

Convert complex field c to RGB via HSV domain coloring.

Parameters:
carray_like of complex

Complex field.

shiftfloat, default=0.0

Phase offset in turns (1.0 = full \(2 \pi\) rotation). Applied to hue.

threshfloat, default=numpy.inf

Optional cap on \(\vert c \vert\) used for magnitude-related terms. Use to prevent very large magnitudes from dominating the encoding.

n_modfloat, default=12.0

Number of modulus steps per \(2 \pi\) in \(\log(\vert c \vert\)). Higher means more concentric rings. Set to 0.0 to disable modulus stepping.

n_phfloat, default=12.0

Number of phase steps per \(2 \pi\) in \(\mathrm{arg}(c)\). Higher means more angular sectors. Set to 0.0 to disable phase stepping.

vminfloat, default=0.35

Minimum brightness for the tiling shading (darkest parts of tiles).

vmaxfloat, default=1.0

Maximum brightness for the tiling shading (brightest parts of tiles). Lowering vmax (e.g. 0.8-0.9) can reduce the “neon” look.

tile_gammafloat, default=1.0

Shapes the within-tile ramp. 1.0 = linear sawtooth. Larger than 1.0 makes tiles stay darker longer and brighten sharply near boundaries. Smaller than 1.0 brightens earlier.

tile_mixfloat in [0, 1], default=0.0

Mix between original magnitude brightness and tiling shading:

  • 0.0: value is \(1 - \exp(- \vert c \vert)\) (original coloring, no tiling influence)

  • 1.0: value is tiling shading only (Wegert-style tiling look)

Intermediate values overlay tiling onto the original magnitude shading.

Notes

The coloring technique is inspired from [1].

References

[1]

Wegert, E. (2015) “Visual Complex Functions: An Introduction +with Phase Portraits”, Springer. doi: https://doi.org/10.1007/978-3-0348-0180-5