bernii / gauge.js

100% native and cool looking JavaScript gauge
MIT License
1.42k stars 391 forks source link

Gauge Color Animation #45

Open briancrumley opened 10 years ago

briancrumley commented 10 years ago

Good Morning!

I've been tinkering with this Gauge and it's a really nice implementation!

One question I had is whether or not it is possible to make it so that the color of the animating arc changes from color to color when it's within ranges instead of animating the RGB values.

So 0-33% = green; 34-66% = yellow; 67-100% = red

Is this possible?

Thanks in advance! Brian

AndreyKozlov1984 commented 10 years ago

That is possible via this: http://jsfiddle.net/berni/Yb4d7/ set percentColors like 0: green, 29.9999: green, 30%: yellow and so on. This way you don't have a gradient.