Created
June 29, 2020 13:11
-
-
Save flabbet/45d41e365dd59d7ea4528a8297cb0c50 to your computer and use it in GitHub Desktop.
Generator of HSL color palette/panel image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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