I'm looking for any way possible to implement an HSL color scheme in my threejs project. I don't see anything after 2013 in the documentation that implements the .setHSL() or .offsetHSL().
What is the best/easiest way to use only HSL in a threejs scene? Thanks!
.setHSL ( h, s, l )thish — hue value between 0.0 and 1.0
s — saturation value between 0.0 and 1.0
l — lightness value between 0.0 and 1.0Sets color from hsl
.getHSL ()hslReturns an object with properties h, s, and l.
.offsetHSL ( h, s, l )thisAdds given h, s, and l to this color's existing h, s, and l values.
three.js - reference - color
var color = new THREE.Color();
color.setHSL( .74, .64, .59 );
console.log('HSL Object:', color.getHSL());
console.log('Hex String:', color.getHexString());
console.log('RGB:', color.getStyle());
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r79/three.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With