randomColor icon indicating copy to clipboard operation
randomColor copied to clipboard

Suggested PR which will allow users to specify independent ranges for H, S and L levels.

Open Xliff opened this issue 6 years ago • 4 comments

Addresses davidmerfield/randomColor#103.

Xliff avatar Feb 13 '19 17:02 Xliff

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.hueRange to options.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.brightnessRange to options.brightness which 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.saturationRange to options.saturation which 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.

davidmerfield avatar Jul 14 '20 19:07 davidmerfield

I'd be happy to, in my Copious Amounts of Free Time™ :)

Xliff avatar Jul 14 '20 21:07 Xliff

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

davidmerfield avatar Jul 15 '20 19:07 davidmerfield

Nope! I think your additions to it are a great idea.

Xliff avatar Jul 15 '20 21:07 Xliff

Controlling Hues would be great, either removing or setting multiple is essentially necessary for me to continue using this library in my project.

energee avatar Sep 18 '23 21:09 energee