Wolfram Computation Meets Knowledge

StyledCurve

Contributed by: Arnoud Buzing

Create a B-spline curve along a color gradient using two colors

ResourceFunction["StyledCurve"][points,{color1,color2}]

gives a B-spline curve with a color gradient from color1 to color2.

Examples

Basic Examples

Make a styled curve:

In[1]:=
Graphics[ResourceFunction[
  "StyledCurve"][{{0, 0}, {1, 1}, {2, -1}, {3, 1}, {4, 0}}, {{1, 0, 0}, {0, 1, 0}}]]
Out[1]=

Make a thick styled curve:

In[2]:=
Graphics[{AbsoluteThickness[10], ResourceFunction[
   "StyledCurve"][{{0, 0}, {1, 1}, {2, -1}, {3, 1}, {4, 0}}, {{1, 0, 0}, {0, 1, 0}}]}]
Out[2]=

Use color names:

In[3]:=
Graphics[{AbsoluteThickness[10], ResourceFunction[
   "StyledCurve"][{{0, 0}, {1, 1}, {2, -1}, {3, 1}, {4, 0}}, {Red, Yellow}]}]
Out[3]=

Use color swatches:

In[4]:=
Graphics[{AbsoluteThickness[10], ResourceFunction[
   "StyledCurve"][{{0, 0}, {1, 1}, {2, -1}, {3, 1}, {4, 0}}, {RGBColor[1, 0, 0], RGBColor[0, 0, 1]}]}]
Out[4]=

Resource History