Function Repository Resource:

StyledCurve

Source Notebook

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

Contributed by: Arnoud Buzing

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

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

Examples

Basic Examples (2) 

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]=

Scope (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]=

Publisher

Arnoud Buzing

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 07 November 2018

License Information