Created
August 26, 2020 04:08
-
-
Save IronOxidizer/48b32c2b372b288343935f02ab8a30f8 to your computer and use it in GitHub Desktop.
Hue to RGB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function h2rgb(h) { | |
let o="rgb("; | |
h=(h+60)%360-120; | |
for(let i=0;i<3;++i)o+=((h=(h+120)%360)<=120?255:(180<=h&&h<=300?0:(Math.abs(h-240)-60)*64/15))+","; | |
return o.slice(0,-1)+")"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment