Skip to content
Closed
5 changes: 0 additions & 5 deletions test/test_wordcloud_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@ def test_check_duplicate_color_error(tmpdir, tmp_text_file):
cli.parse_args(['--color', 'red', '--colormask', str(color_mask_file), '--text', str(tmp_text_file)])


def test_parse_args_defaults_to_random_color(tmp_text_file):
args, text, image_file = cli.parse_args(['--text', str(tmp_text_file)])
assert args['color_func'] == wc.random_color_func


def test_unicode_text_file():
unicode_file = os.path.join(os.path.dirname(__file__), "unicode_text.txt")
args, text, image_file = cli.parse_args(['--text', unicode_file])
Expand Down
4 changes: 2 additions & 2 deletions wordcloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .wordcloud import (WordCloud, STOPWORDS, random_color_func,
from .wordcloud import (WordCloud, STOPWORDS, random_color_func, colormap_color_func,
get_single_color_func)
from .color_from_image import ImageColorGenerator

__all__ = ['WordCloud', 'STOPWORDS', 'random_color_func',
__all__ = ['WordCloud', 'STOPWORDS', 'random_color_func', 'colormap_color_func',
'get_single_color_func', 'ImageColorGenerator',
'__version__']

Expand Down
2 changes: 1 addition & 1 deletion wordcloud/wordcloud_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ def parse_args(arguments):
mask = args.pop('mask')
args['mask'] = np.array(Image.open(mask))

color_func = wc.random_color_func
colormask = args.pop('colormask')
color = args.pop('color')
color_func = wc.colormap_color_func(args['colormap'])
if colormask:
image = np.array(Image.open(colormask))
color_func = wc.ImageColorGenerator(image)
Expand Down