Function Repository Resource:

RYBColor

Source Notebook

Define a color using red, yellow and blue (RYB) values

Contributed by: Aster Ctor

ResourceFunction["RYBColor"][{r,y,b}]

produces a color that is a mixture of the given red, yellow and blue values.

ResourceFunction["RYBColor"][{r,y,b,a}]

produces a color that also uses the alpha channel.

Details and Options

The arguments r, y and b should be numbers between 0 and 1.

Examples

Basic Examples (1) 

Red, Yellow and Blue as primary colors:

In[1]:=
{ResourceFunction["RYBColor"][{1, 0, 0}], ResourceFunction["RYBColor"][{0, 1, 0}], ResourceFunction["RYBColor"][{0, 0, 1}]}
Out[1]=

Scope (1) 

An RYB color with transparency:

In[2]:=
ResourceFunction["RYBColor"][{1, 0, 0, 0.5}]
Out[2]=

Applications (1) 

Visualize the RYB color space:

In[3]:=
Graphics3D[{
  Opacity[.7],
  {RGBColor@ResourceFunction["RYBColor"][#], Cuboid[#, # + .1]} & /@ Tuples[Range[0, 1, .2], 3]
  },
 Axes -> True,
 AxesLabel -> {"Red", "Yellow", "Blue"},
 Lighting -> "Neutral"
 ]
Out[3]=

Properties and Relations (2) 

RYBColor to RGBColor:

In[4]:=
{ryb = ResourceFunction["RYBColor"][{0, 1, 0}], FullForm[ryb]}
Out[4]=
In[5]:=
{RGBColor@ryb, FullForm[RGBColor@ryb]}
Out[5]=

RGBColor to RYBColor:

In[6]:=
{rgb = RGBColor[0, 1, 0, 1], FullForm[rgb]}
Out[6]=
In[7]:=
{ResourceFunction["RYBColor"]@rgb, FullForm[ResourceFunction["RYBColor"]@rgb]}
Out[7]=

Publisher

Aster Ctor (MoeNet)

Version History

  • 1.0.0 – 20 December 2019

License Information