且构网

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

如何“自然地"混合颜色用 C#?

更新时间:2023-02-15 20:48:15

天然湿漆"有点含糊;建议的 CMYK 混合不起作用,因为您仍在添加颜色.

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

如果您想要像 Photoshop 中的结果(如 Jon B 所检查),您需要使用 L*a*b* 空间. RGB 与 Lab 之间的转换公式和描述 在这里.

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.