且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么HSV到RGB算法的工作方式如此?

更新时间:2023-01-23 16:45:02

***的概要:为什么每个案例的选择都是这样的?一个漂亮的防弹方法来编码它,所以我假设你对实现的逻辑混淆。您对此感到困惑,是否正确?

Wikipedia outlines a pretty bulletproof approach to coding it, so I'll assume you're confused about the implementation's logic. You're confused about this, correct?

如果你看看它旁边的图片,你会明白为什么:

If you look at the image adjacent to it, you will see why:

img src =https://i.stack.imgur.com/SeiSb.pngalt =enter image description here>

每个频道的功能是分段的功能由五个线性段组成。案例考虑了每个分布的每个范围,即上图的阴影区域。

Each channel's function is a piecewise function consisting of five linear segments. The cases account for each range of each distribution, namely the shaded regions of the above picture.