How to custom color gradient of highlight mesh effect

As long as your shape has smooth edges you can use the oultine renderer: https://playground.babylonjs.com/#0YG7IF#50

The smooth edge problem is described here: Render Outline - Buggy - #13 by Evgeni_Popov

With the solution to smooth them here :Weird effect when applying overlayColor - #7 by bartbutenaers