1. 2011
    Mar
    28

    Two complex color functions

    In the process of graphing some complex valued functions, I figured out a couple of neat coloring schemes that I thought might be worth sharing. Both schemes share the same hue and saturation functions:

    $$H = \arg{z}-\frac{\pi}{2}$$
    $$S = \abs{\frac{\imag{z}}{z}}$$

    They differ in the third component, though. The one which I will arbitrarily designate “color scheme 1” (because I like it better) is defined in HSL color space, and has a luminosity function of

    $$L = \frac{1}{2}\biggl[1 - 2^{20}\abs{S - \frac{1}{2}}^{20}\sgn\biggl(S - \frac{1}{2}\biggr)\biggr]$$

    where \(S\) is the saturation value. This maps all real or nearly real numbers to white, all imaginary or nearly imaginary numbers to black, and other complex numbers to varying hues depending on their phase.

    The other one, “color scheme 2,” has a value (brightness) function of

    $$V = 1 - \frac{S}{4}$$

    This maps all real or nearly real numbers to white, and all other numbers to varying hues, again depending on their phase. Positive imaginary numbers are red, negative imaginary numbers are cyan.

    Note that both functions are undefined at \(z = 0\). If you implement these you …