Cel shading (Formula)

Use a formula to create a cel shading.