Skip to content

Commit 49e2d2b

Browse files
committed
remore depreciated makeMappingArray (#22)
1 parent 74bc2eb commit 49e2d2b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
setup(
2020
name="stylecloud",
2121
packages=["stylecloud"], # this must be the same as the name above
22-
version="0.5.1",
22+
version="0.5.2",
2323
description="Python package + CLI to generate stylistic wordclouds, "
2424
"including gradients and icon shapes!",
2525
long_description=long_description,
@@ -33,7 +33,7 @@
3333
entry_points={
3434
"console_scripts": ["stylecloud=stylecloud.stylecloud:stylecloud_cli"],
3535
},
36-
python_requires=">=3.5",
36+
python_requires=">=3.6",
3737
include_package_data=True,
3838
install_requires=[
3939
"wordcloud",

stylecloud/stylecloud.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import csv
44
import os
55
from PIL import Image
6-
from matplotlib.colors import makeMappingArray, to_rgb
6+
from matplotlib.colors import to_rgb
77
import numpy as np
88
import fire
99
from shutil import rmtree
@@ -132,7 +132,7 @@ def gen_gradient_mask(
132132
mask_array = np.float32(mask_array)
133133

134134
palette_func = gen_palette(palette)
135-
gradient = np.array(makeMappingArray(size, palette_func.mpl_colormap))
135+
gradient = palette_func.mpl_colormap(np.linspace(0.0, 1.0, size))
136136

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

0 commit comments

Comments
 (0)