Skip to content

Instantly share code, notes, and snippets.

@flabbet
Created June 29, 2020 13:11
Show Gist options
  • Save flabbet/45d41e365dd59d7ea4528a8297cb0c50 to your computer and use it in GitHub Desktop.
Save flabbet/45d41e365dd59d7ea4528a8297cb0c50 to your computer and use it in GitHub Desktop.
Generator of HSL color palette/panel image
from PIL import Image
import colorsys
width = 360
height = 100
image = Image.new("RGB", (width, height))
for y in range(height):
for x in range(width):
color = colorsys.hls_to_rgb(x / 359, abs((y/100) - 1), 1)
image.putpixel((x,y), (int(color[0] * 255), int(color[1] * 255), int(color[2] * 255)))
image.save("ColorPalette.png", "PNG")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment