Skip to content

Commit e5ee30f

Browse files
author
Iver Småge
committed
add transparent background
1 parent c7d09bd commit e5ee30f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ def add_text_to_counter(text: str, counter: Counter):
143143
counter += frequencies
144144

145145
def counter_to_wordcloud(counter: Counter, filename: str):
146-
wordcloud = WordCloud(width=1920, height=1080, colormap=colormap).generate_from_frequencies(counter)
146+
wordcloud = WordCloud(width=1920, height=1080, colormap=colormap, mode="RGBA", background_color=None).generate_from_frequencies(counter)
147147
wordcloud.to_file(filename)
148148

149-
def save_to_pickle(object, pickle_file):
149+
def save_to_pickle(object, pickle_file):
150150
with open(pickle_file, "wb") as file:
151151
pickle.dump(object, file)
152152

@@ -155,7 +155,7 @@ def get_from_pickle(pickle_file):
155155
obj = pickle.load(file)
156156
return obj
157157

158-
colormap: clr.ListedColormap = clr.ListedColormap(["#df6024", "#f28a21", "#f8d164", "#88ba98", "#f0edc9"])
158+
colormap: clr.ListedColormap = clr.ListedColormap(["#df6024ff", "#f28a21ff", "#f8d164ff", "#88ba98ff", "#f0edc9ff"])
159159

160160
if __name__ == "__main__":
161161
pickle_file = pathlib.Path("./link_cache.pickle").resolve()

0 commit comments

Comments
 (0)