d3.js实验室颜色的值范围 [英] d3.js range of values for lab colour
问题描述
我正在研究X色调色板(有点像这一个),但基于d3的实验室色彩空间实现.我已阅读文档此处,这里,甚至查看了源代码
I am working on an X-colours palette (kinda like this one) but based on d3's lab colour space implementation. I have read the documentation here, here and here, even had a look at the source code here and I figured that l-value must be within [0,100] but I couldn't find a range for a and b. Does any value work with them or are they bound to a specific range (like [0, 255] for rgb for example)?
推荐答案
a 参数是黄蓝色范围内的一个点,而 b 参数是一个绿色-洋红色成分中的值.很难确定 a 和 b 的有效范围值,因为有效范围取决于参数 L 的值(预计在[0,100]范围内). 本文包含更多详细信息.您可以使用 d3.interpolateLab(l, a, b)
.在这种情况下,a和b是可以解释为颜色(字符串,d3.rgb, d3.hsv
)的对象.
The a parameter is a point in the range yellow-blue component and the b parameter is a value in the green-magenta component. It's hard to determine valid range values for a and b, as the valid range depends on the value of the parameter L (which is expected to be in the range [0, 100]). This article contains more details. You could use d3.interpolateLab(l, a, b)
. In this context, a and b are object that can be interpreted as colors (string, d3.rgb, d3.hsv
).
这篇关于d3.js实验室颜色的值范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!