Each year there are several challenges for generative arts in the month January called “Genuary” ( https://genuary.art/prompts ). For this #genuary2022 I looked at the prompt “Color gradients gone wrong”, and I could only think of XKCD’s painbow: https://xkcd.com/2537/
Make the painbow color gradient from website data :
In[]:=
colors=ImageData[ImageTake[Import["https://imgs.xkcd.com/comics/painbow_award_2x.png"],{476,90},{670}]][[All,1]];cmap=Blend[Map[Apply[RGBColor]][colors],#]&;
In[]:=
cmap/@Subdivide[20]
Out[]=
{,,,,,,,,,,,,,,,,,,,,}
Create some images:
imgs=ParallelTable[g=Plot3D[Sin[x+y^2+ϕ],{x,-3,3},{y,-2,2},ColorFunction(cmap[#3]&),PlotPoints200,BackgroundRGBColor[0.,0.21,0.46],BoxStyleDirective[White,AbsoluteThickness[4],CapForm["Round"]],Axes->False,ImagePadding->20,ImageSize2×600,PlotRange{-1,1}];img=Rasterize[g,"Image",RasterSize2×600];ImageResize[img,Scaled[0.5]],{ϕ,Most@Subdivide[0,2Pi,50]},Method->"FinestGrained"];
Export the gif:
In[]:=
SetDirectory[NotebookDirectory[]];Export["2022_13.gif",imgs,"DisplayDurations"->1/30]
Out[]=
2022_13.gif