Asymmetrical fill color gradient

Started by MatLcq, October 12, 2020, 10:14:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MatLcq

Hello,

I was just wondering if there was a better way of doing a simple asymmetrical gradient to fill a shape (for graphic purposes).
Here is a customer specification that I have to follow for the gradient of a shape:

---------------------------------
| 40% (RGB1: R1, G1, B1) |
---------------------------------
|                                       |
| 60% (RGB2: R2, G2, B2)|
|                                       |
--------------------------------

So in the fill color of the shape, I define 3 gradient stops: 0%, 40%, 100%.
The first one has the color RGB1.
The second one has a median color RBG with R1 + (R2-R1)/2, G1 + (G2-G1)/2, B1 + (B2-G1)/2 (provided R1,G1,B1 < R2,G2,B2)
The last one has the color RBG2.

Is there a simpler way to have an asymmetrical gradient?

Thanks a lot