kimmobrunfeldt / progressbar.js

Responsive and slick progress bars
https://kimmobrunfeldt.github.io/progressbar.js
MIT License
7.84k stars 1.42k forks source link

Issue with the stroke showing in rgb not HEX #75

Closed phara0hcom closed 9 years ago

phara0hcom commented 9 years ago

I have an issue that the stroke in showing in RGB not HEX so it doesn't show in IE untitled-1 How do I get it in HEX? all the variables are in HEX

my code:

var element = document.getElementById('timeC');
var circle = new ProgressBar.Circle(element, {
    trailColor: '#D8D8D8',
    trailWidth: 10,
    strokeWidth: 10,

    // Set default step function for all animate calls
    step: function(state, circle) {
        circle.path.setAttribute('stroke', state.color);
    }
});

to start the circle:

circle.set(0);
circle.animate(0.5, {
    from: {color: '#00FF00'},
    to: {color: '#FFAE00'},
    duration: 7500
}, function(){
    circle.animate(0.99, {
        from: {color: '#FFAE00'},
        to: {color: '#FF0004'},
        duration: 10000
    });
});
kimmobrunfeldt commented 9 years ago

The conversion from hex to rgb color is done by shifty, tweening library: https://github.com/jeremyckahn/shifty

Are you sure it is IE problem? Which version?

phara0hcom commented 9 years ago

IE 11 on win7

phara0hcom commented 9 years ago

but how do I stop it from converting?

kimmobrunfeldt commented 9 years ago

I don't think that is your real problem. IE should support rgb color definition just as it supports hex. I just tested this with a jsfiddle using IE and it draws the SVG correctly. http://jsfiddle.net/b6fp1sy7/

kimmobrunfeldt commented 9 years ago

That is probably related to CSS layouting. Try to:

#container > svg {
  display: block;
  width: 100%;
}
phara0hcom commented 9 years ago

I can see it because I can see the trail that is colored in HEX but not the stroke...

kimmobrunfeldt commented 9 years ago

I could not confirm this behavior.