The simple answer: you use masks.
We use a mask to paint the inside of the frame. And a mask to cut a hole in the middle.
Holes are not needed. You can form a donut with thick lines. But it was easier for me to draw circular sectors, and then make a hole.
Here it is in the form of SVG. I will leave the conversion to D3.
<svg width="600" height="600">
<defs>
<mask id="innerbevel">
<rect width="100%" height="100%" fill="black"/>
<circle cx="0" cy="0" r="235" fill="white"/>
</mask>
<mask id="centrehole">
<rect x="-100%" y="-100%" width="200%" height="200%" fill="white"/>
<circle cx="0" cy="0" r="195" fill="black"/>
</mask>
</defs>
<g transform="translate(300,300)" mask="url(#centrehole)">
<g>
<path d="M0 0 0 -275 A 275 275 0 0 1 0 275" fill="#89e4d2"/>
<path d="M0 0 0 275 A 275 275 0 0 1 -275 0" fill="#f394a2"/>
<path d="M0 0 -275 0 A 275 275 0 0 1 0 -275" fill="#a3a4ff"/>
<circle cx="0" cy="235" r="40" fill="#89e4d2"/>
<circle cx="-235" cy="0" r="40" fill="#f394a2"/>
<circle cx="0" cy="-235" r="40" fill="#a3a4ff"/>
</g>
<g mask="url(#innerbevel)">
<path d="M0 0 0 -275 A 275 275 0 0 1 0 275" fill="#5bc8b7"/>
<path d="M0 0 0 275 A 275 275 0 0 1 -275 0" fill="#ef6974"/>
<path d="M0 0 -275 0 A 275 275 0 0 1 0 -275" fill="#6b5dff"/>
<circle cx="0" cy="235" r="40" fill="#5bc8b7"/>
<circle cx="-235" cy="0" r="40" fill="#ef6974"/>
<circle cx="0" cy="-235" r="40" fill="#6b5dff"/>
</g>
</g>
</svg>
Run codeHide result source
share