MCPcopy
hub / github.com/brianchirls/Seriously.js / hue2rgb

Function hue2rgb

lib/three.js:314–323  ·  view source on GitHub ↗
( p, q, t )

Source from the content-addressed store, hash-verified

312 } else {
313
314 var hue2rgb = function ( p, q, t ) {
315
316 if ( t < 0 ) t += 1;
317 if ( t > 1 ) t -= 1;
318 if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;
319 if ( t < 1 / 2 ) return q;
320 if ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );
321 return p;
322
323 };
324
325 var p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );
326 var q = ( 2 * l ) - p;

Callers 1

three.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected