Is it possible to dynamically fill a SVG image with color based on a percentage?
I would like to be able to change the color of an SVG image based on a specified percentage.
For example, I have an SVG image of the moon and I want to fill it with white color based on the illumination percentage of the moon.
So if the illumination percentage is 90%, the moon should be filled with 90% white color, and so on.
<?xml version="1.0" encoding="iso-8859-1"?>
<svg xmlns="http://www.w3.org/2000/svg" width="139" height="134">
<g>
<circle stroke-width="7" stroke="#000" fill="#fff" r="58" cy="69" cx="69"/>
<path stroke-width="0" fill="#000" d="m69,9 a62,60 0 0 0 1,121 l0,-5 a70,68 0 0 1 0,-110 l0,-5 z"/>
</g></svg>