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!
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!
Share Improve this question edited May 13, 2022 at 2:42 ksav 20.9k6 gold badges51 silver badges69 bronze badges asked Sep 20, 2016 at 14:37 EJWEJW 6142 gold badges10 silver badges23 bronze badges 01 Answer
Reset to default 7
.setHSL ( h, s, l )
this
h — 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 ()
hsl
Returns an object with properties h, s, and l.
.offsetHSL ( h, s, l )
this
Adds 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./ajax/libs/three.js/r79/three.js"></script>