【发布时间】:2014-07-05 04:08:11
【问题描述】:
我想将一些颜色值从众所周知的 HSL 转换为鲜为人知的 HSLum 怎么做?
hsl(0, 1.0, 0.5) - rgb red is hslum(0, 1.0., 0.54)
hsl(120, 1.0, 0.5 - rgb green is hslum(0, 1.0, 0.80)
hsl(240, 1.0, 0.5) - rgb blue is hslum(0, 1.0, 0.44)
据我所知,亮度(不是亮度)是这样计算的:
Y = 0.2126 * R + 0.7152 * G + 0.0722 * B
我看了一些文章:Luminance (relative)、21296247、HSL and HSV、luma、Lightness、Munsell,但没有找到解决方案?
据我所知,CIELab 1976 公式接近Munsell:
1.16*(Y/Ymax)^1.16*(Y/Ymax)^(1.0/3.0)-0.16 where Y/Ymax > 0.01
或者更好的插值/
1.16*(Y/Ymax)^(1.0/3.0)-0.16 where Y/Ymax > (6/29)^3
1.16*(841.0/108.0)*(Y/Ymax)+(4.0/29.0)-0.16 where Y/Ymax <= (6/29)^3
如何进行此类转换?
- HSL -> HSLum
- HSLum -> HSL
- HSLum -> RGB
欢迎任何提示 - 算法建议。
这里有一些工具在做HSLum。
【问题讨论】:
-
您是否找到了执行给定转换的算法?我需要 HSLum 到 HSL 的转换,但这里没有最终答案...
标签: graphics colors color-scheme luminance