How to mix colors “naturally” with C#?

你。 提交于 2019-11-26 21:39:37

"Natural wet paint" is a little ambiguous; the mixing of CMYK as suggested won't work because you're still adding colors.

If you want results like in Photoshop (as Jon B checked) you need to use L*a*b* space. Formulas for converting RGB to/from Lab and a description is here.

Lab space was specifically designed so that linear changes correspond to what the human eye perceives as a certain amount of color change. This is important because e.g. we are more sensitive to green than other colors, because we perceive changes differently depending both on hue and lightness, etc..

Trying any other methods currently being suggested will not only result in colors you don't want, but also won't represent a "constant-looking" change in color, especially if you use this for something where constant-change matters like a gradient.

There is a good article for converting RGB to Lab in C# at http://www.codeproject.com/KB/recipes/colorspace1.aspx.

Bart

You get cmyk<->rgb conversion for free with WIC. but it's .NET 3.0 only

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!