Function Repository Resource:

# ViridisColor

Get one of five related color schemes with favorable perceptual properties

Contributed by: Julien Kluge
 ResourceFunction["ViridisColor"][x] evaluates the viridis color scheme at x. ResourceFunction["ViridisColor"]["cname",x] evaluates the color scheme specified by "cname" at x. ResourceFunction["ViridisColor"][{xmin,xmax},x] evaluates the viridis color scheme at x between xmin and xmax. ResourceFunction["ViridisColor"]["Reverse",x] evaluates the viridis color scheme at x with reversed color order. ResourceFunction["ViridisColor"][{"cname","Reverse"},x] evaluates the color scheme specified by "cname" in reverse at x. ResourceFunction["ViridisColor"][{"cname",{xmin,xmax}},x] evaluates the color scheme specified by "cname" at x between xmin and xmax.

## Details

The color scheme "cname" can be any of "Cividis", "Magma", "Inferno", "Plasma" and "Viridis".
ResourceFunction["ViridisColor"][x] is equivalent to ResourceFunction["ViridisColor"]["Viridis",x].

## Examples

### Basic Examples (2)

Evaluate the viridis color map for a value of 0.8:

 In[1]:=
 Out[1]=

Use the viridis color map for a density plot:

 In[2]:=
 Out[2]=

### Scope (4)

List the available color schemes:

 In[3]:=
 Out[3]=

Get a color scheme by name and use it:

 In[4]:=
 Out[4]=

Get a reversed color scheme by name and use it:

 In[5]:=
 Out[5]=

ViridisColor supports a family of all related color maps, with viridis as the default:

 In[6]:=
 Out[6]=

### Applications (2)

Use the viridis color scheme in Plot3D:

 In[7]:=
 Out[7]=

Color an image with the viridis color scheme:

 In[8]:=
 Out[8]=

### Properties and Relations (4)

ViridisColor clamps the input to a region of zero to one:

 In[9]:=
 Out[9]=

ViridisColor can be used with a range specification:

 In[10]:=
 Out[10]=

ViridisColor can be used with a range and color specification:

 In[11]:=
 Out[11]=

Converted to grayscale, all color maps yield a dark to light gradient:

 In[12]:=
 Out[12]=

### Possible Issues (1)

ViridisColor clamps values and thus needs ColorFunctionScaling to be True to use the whole value range:

 In[13]:=
 Out[13]=

### Neat Examples (1)

All color maps and especially cividis are colorblind friendly:

 In[14]:=
 Out[14]=

Julien Kluge

## Version History

• 1.0.0 – 01 February 2022