def colors_like(color, arr, colormap=DEFAULT_COLORMAP):
    '''
    Given an array of size NxM (usually Nx3), we accept color in the following ways:
    - A string color name. The accepted names are roughly what's in X11's rgb.txt
    - An explicit rgb triple, in (3, ), (3, 1), or (1, 3) shape
    - A list of values (N, ), (N, 1), or (1, N) that are put through a colormap to get per vertex color
    - An array of colors (N, 3) or (3, N)

    There is a potential for conflict here if N == 3. In that case we assume a value is an rgb triple,
    not a colormap index. This is a sort of degenerate case, as a mesh with three verticies is just a single
    triangle and not something we ever actually use in practice.
    '''
    import numpy as np
    from blmath.numerics import is_empty_arraylike
    if is_empty_arraylike(color):
        return None
    if isinstance(color, basestring):
        from lace.color_names import name_to_rgb
        color = name_to_rgb[color]
    elif isinstance(color, list):
        color = np.array(color)
    color = np.squeeze(color)
    num_verts = arr.shape[0]
    if color.ndim == 1:
        if color.shape[0] == 3: # rgb triple
            return np.ones((num_verts, 3)) * np.array([color])
        else:
            from matplotlib import cm
            return np.ones((num_verts, 3)) * cm.get_cmap(colormap)(color.flatten())[:, :3]
    elif color.ndim == 2:
        if color.shape[1] == num_verts:
            color = color.T
        return np.ones((num_verts, 3)) * color
    else:
        raise ValueError("Colors must be specified as one or two dimensions")
Given an array of size NxM (usually Nx3), we accept color in the following ways:
    - A string color name. The accepted names are roughly what's in X11's rgb.txt
    - An explicit rgb triple, in (3, ), (3, 1), or (1, 3) shape
    - A list of values (N, ), (N, 1), or (1, N) that are put through a colormap to get per vertex color
    - An array of colors (N, 3) or (3, N)

    There is a potential for conflict here if N == 3. In that case we assume a value is an rgb triple,
    not a colormap index. This is a sort of degenerate case, as a mesh with three verticies is just a single
    triangle and not something we ever actually use in practice.