polotno-project / polotno-board

Roadmap and bug-tracker for the Polotno project.
https://polotno.dev/
9 stars 1 forks source link

Svg replace color error. #73

Closed alexandruIonutZ closed 4 months ago

alexandruIonutZ commented 4 months ago

Hello, i have a problem.

I use store.selectedElements[0].replaceColor(oldColor, newColor) and works just for the first time.

For example: store.selectedElements[0].replaceColor('red', 'blue') -> the red is replaced with blue then if i make store.selectedElements[0].replaceColor('blue', 'black') the blue is not changing.

lavrton commented 4 months ago

The second call should be store.selectedElements[0].replaceColor('red', 'black') The first argument is a color from ORIGINAL svg image (defined via src attribute). So it shouldn't change.