HCL color to RGB and backward

后端 未结 5 1559
天涯浪人
天涯浪人 2020-12-28 19:51

I need an algorithm to convert the HCL color to RGB and backward RGB to HCL keeping in mind that these color spaces have different gamuts (I need to constrain the HCL colors

5条回答
  •  再見小時候
    2020-12-28 20:14

    I'm familiar with quite a few color spaces, but this one is new to me. Alas, Mathematica's ColorConvert doesn't know it either.

    I found an rgb2hcl routine here, but no routine going the other way.

    A more comprehensive colorspace conversion package can be found here. It seems to be able to do conversions to and from all kinds of color spaces. Look for the file colorspace.c in colorspace_1.1-0.tar.gz\colorspace_1.1-0.tar\colorspace\src. Note that HCL is known as PolarLUV in this package.

提交回复
热议问题