HCL color to RGB and backward

后端 未结 5 1564
天涯浪人
天涯浪人 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:17

    I think

    if (rg <  0) {
        if (gb >= 0) H = 90 + H;
        else { H = H - 90; }
    } //works
    

    is not really necessary because of atan2(,) instead of atan(/) from paper (but dont now anything about java atan2(,) especially

提交回复
热议问题