def tint(col, factor=1.0):
    """Tint a color (make it darker), returning a new RGB array
    """
    # this method is more complicated than it need be to
    # support matplotlib-1.x.
    # for matplotlib-2.x this would just be
    #     h, s, v = colors.rgb_to_hsv(colors.to_rgb(c))
    #     v *= factor
    #     return colors.hsv_to_rgb((h, s, v))
    rgb = numpy.array(to_rgb(col), ndmin=3)
    hsv = colors.rgb_to_hsv(rgb)
    hsv[-1][-1][2] *= factor
    return colors.hsv_to_rgb(hsv)[-1][-1]
def tint ( col , factor = 1.0 ) : rgb = numpy . array ( to_rgb ( col ) , ndmin = 3 ) hsv = colors . rgb_to_hsv ( rgb ) hsv [ - 1 ] [ - 1 ] [ 2 ] *= factor return colors . hsv_to_rgb ( hsv ) [ - 1 ] [ - 1 ]
Tint a color (make it darker), returning a new RGB array