randomColor
randomColor copied to clipboard
Suggested PR which will allow users to specify independent ranges for H, S and L levels.
Addresses davidmerfield/randomColor#103.
Hello! Thanks for this, I like it. I also want to propose a few changes to this PR, which I'm more than happy to implement myself as needed.
These are by no means set in stone and I'm happy to discuss them:
- [ ] rename
options.hueRangetooptions.hue, which can now be a color string, an integer, or an array of two integers:
randomColor({ hue: 'orange' });
randomColor({ hue: 123 });
randomColor({ hue: [123, 300] });
- [ ] rename
options.brightnessRangetooptions.brightnesswhich can now be a string, an integer, or an array of two integers:
randomColor({brightness: 'bright'} );
randomColor({brightness: 50});
randomColor({brightness: [25, 75]});
- [ ] rename
options.saturationRangetooptions.saturationwhich can now be an integer, or an array of two integers:
randomColor({ saturation: 25 });
randomColor({ saturation: [60, 80] });
- [ ] Update the documentation
Eventually we'd deprecate options.luminosity and use options.brightness going forward, but that's for another PR.
I'd be happy to, in my Copious Amounts of Free Time™ :)
Ha! I wasn't asking you to do this – I wanted to get your feedback on these changes in case you had any thoughts before I went ahead and implemented them
Nope! I think your additions to it are a great idea.
Controlling Hues would be great, either removing or setting multiple is essentially necessary for me to continue using this library in my project.