Created
July 19, 2022 05:12
-
-
Save LTLA/d665c748ed091dea2ef4aad5ddb85211 to your computer and use it in GitHub Desktop.
Decent HCL random color generation
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
# The hue is evenly distributed along the circle; | |
# we oscillate the luminescence to provide a better | |
# distinction between similar colors. | |
n <- 30 | |
i <- head(seq(0, 360, length.out=n+1), -1) | |
cols <- hcl(i, c=50, l=80 + 10 * sin(i/30 * pi)) | |
plot(seq_along(cols), col=cols, pch=16, cex=5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment