Gradient Fill Using Graphics in Mathematica

How can I create the following using Rectangle[] in Graphics[] ?

enter image description here

+6
source share
2 answers

Using Polygon , you can

 Graphics[{EdgeForm[Black], Polygon[{{0, 0}, {3, 0}, {3, 1}, {0, 1}}, VertexColors -> {White, Red, Red, White}]}] 
+7
source

also:

 Graphics[Raster[{Range[100]/100}, ColorFunction -> (Blend[{White, Red}, #] &)], AspectRatio -> .3, Frame -> True, FrameTicks -> None] 

enter image description here

+5
source

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


All Articles