The closest I am aware of is this combination of Prolog
, Polygon
, VertexColors
, and Scaled
coordinates:
Graphics[
{Disk[], Red, Rectangle[{-.75, 1}, {.5, -.5}]},
Prolog ->
Polygon[
Scaled /@ {{0, 0}, {0, 1}, {1, 1}, {1, 0}},
VertexColors -> {Yellow, Green, Magenta, Pink}
]
]
More complicated gradients can be formed by stacking Polygons:
Graphics[
{Disk[], Red, Rectangle[{-.75, 1}, {.5, -.5}]},
Prolog ->
{Polygon[
Scaled /@ {{0, 0}, {0, 1/2}, {1, 1/2}, {1, 0}},
VertexColors -> {Red, Yellow, Pink, Blue}
],
Polygon[
Scaled /@ {{0, 1/2}, {0, 1}, {1, 1}, {1, 1/2}},
VertexColors -> {Yellow, Green, Magenta, Pink}
]}
]
If you struggle with turning this into a function let me know where you had trouble and I will try to help.
Please ask your future questions on the dedicated Mathematica StackExchange site: