0

I would like to be able to vary color of a graphics primitive. For starters, varying color of a Line object along it's length would be sufficient. For example, if I have a ColorDataFunction function f, the first point of the the line, the color would be f[0] and the last point f[1]. Or something similar. The only idea I got was to take ColorData[myScheme, "Image"] and transform it as needed or somehow exploit a ParametricPlot. But this both seems really clumsy. Is there a better way? Essentially, I would like something equivalent to adding a ColorFunction-like parameter to Graphics.

user1747134
  • 777
  • 4
  • 11

1 Answers1

2

Just use VertexColors like @Kuba said:

enter image description here

M.R.
  • 31,425
  • 8
  • 90
  • 281