最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Has Three.js setHSL() been deprecated? - Stack Overflow

programmeradmin2浏览0评论

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 0
Add a ment  | 

1 Answer 1

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.0

Sets 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>

发布评论

评论列表(0)

  1. 暂无评论