Coloring the faces of a graph

Coloring the faces of a graph

\documentclass[border=10pt]{standalone}
\usepackage[inline]{asymptote}
\begin{document}
\begin{asy}[width=\the\linewidth,inline=true]
pen lineAb=black+3pt;
pen lineAt=white+1.2pt;
pen lineB=dashed+darkblue+1.3pt;
pen circA=lightyellow;
pen circB=darkblue;
pen rimA=red;
pen rimB=blue;
pen shade=springgreen;
guide circ=unitcircle;
real d=5;
pair a,b,c,u;
a=(0,-d); b=(d,-d);
c=(d,0); u=1.618b;
guide ga=shift(a.x,a.y)*circ;
guide gc=shift(c.x,c.y)*circ;
guide garc=a{dir(-45)}..u..{dir(135)}c;
pair xa=intersectionpoint(ga,c--a);
pair xc=intersectionpoint(gc,a--c);
pair xab=intersectionpoint(ga,a--b);
pair xbc=intersectionpoint(gc,b--c);
pair xau=intersectionpoint(ga,garc);
pair xuc=intersectionpoint(gc,garc);

void base(real phi=0,pen shade=currentpen){
  transform t=rotate(phi);
  fill(t*(a{dir(-45)}..u..{dir(135)}c--cycle),shade);
  draw(t*(xab--b--xbc),lineAb);
  draw(t*(xab--b--xbc),lineAt);
  draw(t*(xc--xa),lineB,Arrow);
  draw(t*(xau{dir(-45)}..u..{dir(135)}xuc),lineB,Arrow); 
  filldraw(t*shift(a.x,a.y)*circ,circA,rimA);
  filldraw(t*shift(b.x,b.y)*circ,circB,rimB);
}

currentpen=orange+opacity(0.5);
base(); base(90,palegreen);
base(180,pink); base(-90,paleyellow);
filldraw(ga,circA,rimA);
\end{asy}
\end{document}

Source: TeX.SE

Author: g.kov (License)