Skip to content

Instantly share code, notes, and snippets.

View markdimi's full-sized avatar
🏋️‍♂️
Linear progression

Markos Dimitsas markdimi

🏋️‍♂️
Linear progression
  • Codebasegr
  • Between Germany and Greece
View GitHub Profile
@markdimi
markdimi / colored_dots.py
Last active May 12, 2019 14:29
Colored Icons to use in a palette
# A simple function that uses python3 and matplotlib, and creates a plain colored circle (transparent png image 500x500 px).
# Inputs are the color_list and and the name of the file.
# The color_list can include multiple colors. A single color create a circle with that color.
# Multiple colors create a circle divided equally by the sum of the colors
# my_dpi variable is needed in order to make matplotlib to print an image with a specific size (usually dpi=96).
# More on this SO post: https://stackoverflow.com/questions/13714454/specifying-and-saving-a-figure-with-exact-size-in-pixels
#
# here we are ploting a 500x500 image
# you can find your dpi by going here: https://www.infobyip.com/detectmonitordpi.php