When it comes to gradient fill, you can check the code for contour gradient here:
the solution is based on passing the info about the lines the shape is made of into the shader and colorize depending on the pixel distance from the shape border.
Also, you could use edge highlighting to achieve this effect, here is an example: