I extended this to include additional color spaces such as Hsl, hsv, Lch, Lab amongst others in VBA from which you can generate a selection of color palettes. Here’s the Google Apps Script version. This extensive library of color conversions are available in this shared GAS library. I must admit I found the math a little trickier in the GAS version.
5 color pallete
For more stuff like this, see from VBA to Google Apps Script
po.src = ‘https://apis.google.com/js/plusone.js’;
var s = document.getElementsByTagName(‘script’); s.parentNode.insertBefore(po, s);