'Angular google maps polyline gradient based on date

In my Angular app I have google maps component on which I want to display the route. I use map-polyline and pass locations to the path parameter. What I would like to achieve is gradient color - the earliest would be lightblue and the latest would be darkblue. Basically something like this:

Picture on the left

Thank you in advance !



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source