Issue snap 0.5 build: 2017-02-06 Elem.attr("fill")
I get this new error with the following code (with snap.svg.js 0.5 build: 2017-02-06):
`var s = Snap("#svg1"); var r = s.rect(100,100,100,100).attr({ stroke: '#123456', 'strokeWidth': 20, fill: 'red', 'opacity': 1 });
console.log(r.attr("fill"));
Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'rgb(255, 0, 0)' is not a valid selector.
at Snap (http://127.0.0.1:38233/test-snap-0.5/code/snap.svg.js:901:30)
at Element.
Can someone confirm?
thank you
Is this with v0.5.1?
Fixed in 0.5.1
I am still having this issue and am using version 0.5.1. I am trying to animate a fill from a path using the following code el.animate({'fill': 'red'},1000);
Can confirm this http://jsfiddle.net/qywLcpqe/
Hmm that's using 0.5.0 from a cdn, just double checking
I note https://github.com/adobe-webplatform/Snap.svg/blob/master/dist/snap.svg.js has 0.5.1 written at the top, but 0.5.0 lower down for Eve and version. The cdn at https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.5.1/snap.svg.js for example for 0.5.1 says 0.5.0 at the top and lower down, so it looks a bit confusing.
Not sure if that's correct, as I'm not so familiar with that side of things, but thought I would mention it in case.
Thanks a million 👍 ! I was using the cdn link in my code and have just downloaded the latest distribution and works perfectly!
That's great. Missing piece of the puzzle for me, is how CDNs get their files in the first place.
it still happening ... in version 0.5.1 . how can i animate my fill color in svg?
You could probably build the fill manually, and use the Snap.animate( from, to, function, duration, callback) method and use rgb() as an interim measure
Something like..
Snap.animate( [10,10,10],[20,30,40], function( val ) { el.attr('fill', 'rgb('+val[0]+','+val[1]+','+val[2]+')') }, 2000 );
On Wed, Jan 17, 2018 at 3:29 AM, guirenpei [email protected] wrote:
it still happening ... in version 0.5.1 . how can i animate my fill color in svg?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/adobe-webplatform/Snap.svg/issues/504#issuecomment-358186354, or mute the thread https://github.com/notifications/unsubscribe-auth/ADuG9Zz5-WK_P91u9e15xIBR8Il4F40Nks5tLWkrgaJpZM4L4EFh .
Confirm resolved in 0.5.1. As above there is confusing version on CDN that has filename 0.5.1 but is actually 0.5.0.