def moreland_adjusthue (msh, m_unsat):
    """Moreland's AdjustHue procedure to adjust the hue value of an Msh color
    based on ... some criterion.

    *msh* should be of of shape (3, ). *m_unsat* is a scalar.

    Return value is the adjusted h (hue) value.

    """
    if msh[M] >= m_unsat:
        return msh[H] # "Best we can do"

    hspin = (msh[S] * np.sqrt (m_unsat**2 - msh[M]**2) /
             (msh[M] * np.sin (msh[S])))

    if msh[H] > -np.pi / 3: # "Spin away from purple"
        return msh[H] + hspin
    return msh[H] - hspin
Moreland's AdjustHue procedure to adjust the hue value of an Msh color
    based on ... some criterion.

    *msh* should be of of shape (3, ). *m_unsat* is a scalar.

    Return value is the adjusted h (hue) value.