forked from matplotlib/matplotlib
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve docstring and add test fot to_rgb(<float>)
Even if the docstring was saing it, emphasis that to_rgb/to_rgba do not accept float as input, but string representation of a float. As one might be tempted to had float->gray conversion add failing test in case the functionality is added. Side fixes : change tuple([value]*3) to (value,)*3 for speed In [18]: %timeit tuple([0.4]*3) 1000000 loops, best of 3: 505 ns per loop In [19]: %timeit (0.4,)*3 10000000 loops, best of 3: 23.5 ns per loop In [20]: (0.4,)*3 == tuple([0.4]*3) Out[20]: True Closes matplotlibgh-2609
- Loading branch information
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters