RGB, HSV, and HSL color conversion algorithms in JavaScript. Copied from https://gist.github.com/mjijackson/5311256