MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / hue2rgb

Function hue2rgb

assets/js/avatarMaker_js/html2canvas.js:1787–1806  ·  view source on GitHub ↗
(t1, t2, hue)

Source from the content-addressed store, hash-verified

1785 return 0;
1786 };
1787 function hue2rgb(t1, t2, hue) {
1788 if (hue < 0) {
1789 hue += 1;
1790 }
1791 if (hue >= 1) {
1792 hue -= 1;
1793 }
1794 if (hue < 1 / 6) {
1795 return (t2 - t1) * hue * 6 + t1;
1796 }
1797 else if (hue < 1 / 2) {
1798 return t2;
1799 }
1800 else if (hue < 2 / 3) {
1801 return (t2 - t1) * 6 * (2 / 3 - hue) + t1;
1802 }
1803 else {
1804 return t1;
1805 }
1806 }
1807 var hsl = function (args) {
1808 var tokens = args.filter(nonFunctionArgSeparator);
1809 var hue = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3];

Callers 1

hslFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected