Here’s a tiny little script that gives you two colors: one dark and one light.
I needed an easy way to create pairs of colors that were distinct enough to be used for foreground and background colors.
Right now, this package uses randomcolor to generate colors. randomcolor
allows you to specify luminosity when generating colors, so I just generate one ‘light’ color and one ‘dark’ color and return the results.
This was a super quick and easy project to throw together, and it was a good way to practice testing, documenting, and publishing npm packages. Plus, it’s useful for another project I’m working on.
In the future, I could see improving this to make the color pairs more pleasing. But for now, this’ll do just fine.