Created
November 1, 2023 10:35
-
-
Save Bouni/19eb4e07c312944790d3e2a69f025b9f to your computer and use it in GitHub Desktop.
Generate a list of rainbow colors with n entries
This file contains hidden or 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
def rainbow_color_stops(n=10, end=2 / 3): | |
rgb = [hls_to_rgb(end * i / (n - 1), 0.5, 1) for i in range(n)] | |
hex = [f"#{int(255.0*r):02x}{int(255.0*g):02x}{int(255.0*b):02x}" for r, g, b in rgb] | |
return hex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment