How to create Duotone interpolation color in GDI + (.NET)?

I have two colors that I need to linearly interpolate to create a duet color based on a different color brightness value.

Dim clr1 = Color.Black
Dim clr2 = Color.FromArgb(224, 255, 165)
Dim lum = Color.FromArgb(226, 189, 136).GetBrightness
'lum = 0.71

I know that the result should be R = 171, G = 192, B = 125, but I cannot figure out how to do this. I looked over at https://stackoverflow.com/a/2129609/169/11/16/11/11/11/11/11/11/11/11/11/11.jpg I looked over at https://stackoverflow.com/a/464616/16/1149119/ ... pretty bit all over google, but couldn't find a way to create this result. Can anyone help?

+3
source share
1 answer

It turned out that the value of my was lumsupposed to use relative brightness .

+3
source

Source: https://habr.com/ru/post/1749117/


All Articles