Svg file 2 layer change colour each layer

edited February 2016 in How To...

I Have a Svg File With 2 Layers. I want to change each layer to different colours. I don'T know what is the best way. Load it as two files and merge it in the code of just load one file with two layers. In total I have 7 icons each icon as a top colour and a background colour. All icon will have the same top and background colour but will change each frame.

Let me know what is the best way . And if it to load one file with two layers, can you let me know the way? thanks

Answers

  • Screen Shot 2016-02-28 at 23.49.54

    I will like to change the pink(front Layer)for another colour and the white(back layer) for another colour grey is transparency. It stays as SVG format . I use processing.pdf library it to eventually print.

  • I have tried this

    pushStyle();
      back[ImgNum].disableStyle();
      shape(back[ImgNum], xImg, yImg, sImg, sImg);
      noStroke();
      fill (colFill[2]);
      back[ImgNum].enableStyle();
      popStyle();
    
      pushStyle();
      icon[ImgNum].disableStyle();
      noStroke();
      fill (colOutL[2]);
      shape(icon[ImgNum], xImg, yImg, sImg, sImg);
      icon[ImgNum].enableStyle();
      popStyle();
    

    But the first colour change does not apply, only one can work at the time. I have tried without the pop style but both shape takes fill (colOutL[2]);

Sign In or Register to comment.