RSS Git Download  Clone
  hilbert Convert to module 7 months ago
  .gitignore 19B Added .gitignore 5 months ago
  README.md 809B Fixed indentation in README.md 7 months ago
  hilbert.png 11kB README 7 months ago
  main.py 372B Convert to module 7 months ago
  README.md
# Hilbert curve Draw hilbert curves as an image. # How to run ``` $ python main.py ``` ![Output](hilbert.png) # Documentation direction is an ```int``` type representing the 4 directions in a 2D plane - left, top, right, bottom ```python from PIL import Image colors = ("blue", "orange", "green", "red", "violet", "brown", "pink", "gray", "yellow", "cyan") img = Image.new("RGB", (1000, 1000), color="white") draw_hilbert(image=img, # Image object from Pillow direction=0, # 0 means the curve starts from the left depth=4, # How many levels deep we should go while dividing the image into quandrants colors=c, # All the different colors that the line segments will be drawin in width=50) # Width of the line segment img.show() ```