HSV颜色为RGB颜色的算法 - 线性插值颜色 [英] HSV color to RGB color Algorithm - Linearly Interpolated colors

查看:934
本文介绍了HSV颜色为RGB颜色的算法 - 线性插值颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开发的算法,用于将HSV颜色值转换成RGB颜色,并解释如何和为什么它工作正常。然后考虑两个HSV颜色H1 =(156,0.625,0.8)和h2 =(300,0.6,0.5),并将其转换成RGB(给出r1和r2),CMY(C1,C2),和CMYK(K1,K2 )。最后,计算线性插值颜色H3 = 0.3h1 + 0.7h2和R3 = 0.3r1 + 0.7r2,并已经转化成R3 HSV后,对它们进行比较。

Develop an algorithm for converting an HSV colour value into RGB colour and explain how and why it works correctly. Then consider the two HSV colours h1 = (156, 0.625, 0.8) and h2 = (300, 0.6, 0.5) and convert them into RGB (giving r1 and r2), CMY (c1, c2), and CMYK (k1, k2). Finally, compute the linearly interpolated colors h3 = 0.3h1 + 0.7h2 and r3 = 0.3r1 + 0.7r2 and compare them after having converted r3 into HSV.

我发现从维基百科,但我不知道我需要做的,以获得正确的结果。我很困惑与CMY和CMYK和线性插值的颜色我已经计算过。因此,任何帮助将不胜AP preciated。

I have found the formula from the Wikipedia but I don't know what I have to do in order to get the correct result. I am confused with the CMY and CMYK and the linearly interpolated colors I have to compute too. So any help will be greatly appreciated.

推荐答案

这个网站帮助了我很多与做颜色转换时,数学方: http://easyrgb.com/index.php?X=MATH

This site helped me a lot with the math side when doing color conversion: http://easyrgb.com/index.php?X=MATH

请记住,你需要为了有对CMYK和RGB值任何意义的配置文件。

Keep in mind that you need a profile in order to have any meaning for the CMYK and RGB values.

这篇关于HSV颜色为RGB颜色的算法 - 线性插值颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆