def cielab_to_msh (cielab):
    """Convert CIE L*a*b* to Moreland's Msh colorspace.

    *cielab* should be of shape (*, 3).

    Return value will have same shape.

    """
    msh = np.empty_like (cielab)
    msh[...,M] = np.sqrt ((cielab**2).sum (axis=-1))
    msh[...,S] = np.arccos (cielab[...,L] / msh[...,M])
    msh[...,H] = np.arctan2 (cielab[...,B], cielab[...,A])
    return msh
def cielab_to_msh ( cielab ) : msh = np . empty_like ( cielab ) msh [ ... , M ] = np . sqrt ( ( cielab ** 2 ) . sum ( axis = - 1 ) ) msh [ ... , S ] = np . arccos ( cielab [ ... , L ] / msh [ ... , M ] ) msh [ ... , H ] = np . arctan2 ( cielab [ ... , B ] , cielab [ ... , A ] ) return msh
Convert CIE L*a*b* to Moreland's Msh colorspace.

    *cielab* should be of shape (*, 3).

    Return value will have same shape.