News:

Happy New Year!

Main Menu

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

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 129 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1049KB.
Tokens: post-login.
Cache hits: 13: 0.00256s for 26,600 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]