Skip to content

Commit

Permalink
remore depreciated makeMappingArray (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
minimaxir committed Apr 30, 2021
1 parent 74bc2eb commit 49e2d2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
setup(
name="stylecloud",
packages=["stylecloud"], # this must be the same as the name above
version="0.5.1",
version="0.5.2",
description="Python package + CLI to generate stylistic wordclouds, "
"including gradients and icon shapes!",
long_description=long_description,
Expand All @@ -33,7 +33,7 @@
entry_points={
"console_scripts": ["stylecloud=stylecloud.stylecloud:stylecloud_cli"],
},
python_requires=">=3.5",
python_requires=">=3.6",
include_package_data=True,
install_requires=[
"wordcloud",
Expand Down
4 changes: 2 additions & 2 deletions stylecloud/stylecloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import csv
import os
from PIL import Image
from matplotlib.colors import makeMappingArray, to_rgb
from matplotlib.colors import to_rgb
import numpy as np
import fire
from shutil import rmtree
Expand Down Expand Up @@ -132,7 +132,7 @@ def gen_gradient_mask(
mask_array = np.float32(mask_array)

palette_func = gen_palette(palette)
gradient = np.array(makeMappingArray(size, palette_func.mpl_colormap))
gradient = palette_func.mpl_colormap(np.linspace(0.0, 1.0, size))

# matplotlib color maps are from range of (0, 1). Convert to RGB.
gradient *= 255.0
Expand Down

0 comments on commit 49e2d2b

Please sign in to comment.