Function Repository Resource:

ColorChanger

Source Notebook

Interactively substitute colors in a graphic

Contributed by: Bob Sandheinrich

ResourceFunction["ColorChanger"][gr]

creates a dynamic interface for changing the most common colors in a Graphics or Graphics3D object.

ResourceFunction["ColorChanger"][gr,n]

makes the n most common colors changeable.

Details

An interface for choosing colors is presented along side the graphic. The interface includes the original color and a ColorSlider for selecting the new color.
Copy and Print buttons are provided for retrieving the modified graphic.

Examples

Basic Examples (2) 

Create a color changer for a plot:

In[1]:=
ResourceFunction["ColorChanger"][Plot[{Sin[x], Cos[4 x]}, {x, 0, Pi}]]
Out[1]=

Change a color and use the Print button:

Out[2]=

A ListPlot with three colors:

In[3]:=
ResourceFunction["ColorChanger"][
 ListPlot[
  Table[{k, PDF[BinomialDistribution[50, p], k]}, {p, {0.3, 0.5, 0.8}}, {k, 0,
     50}], Filling -> Axis], 3]
Out[3]=

Scope (1) 

Modify colors of a graph in 3D:

In[4]:=
ResourceFunction["ColorChanger"][
 GraphPlot3D[
  ButterflyGraph[2, VertexStyle -> Red, EdgeStyle -> Green]]]
Out[4]=

Publisher

Bob

Version History

  • 1.0.0 – 15 November 2023

Related Resources

License Information