A colored pattern but a little change to the random function in TikZ is required











up vote
2
down vote

favorite












Consider the following MWE:



documentclass[border=0pt,tikz]{standalone}
definecolor{elila}{RGB}{186,85,211}
definecolor{zlila}{RGB}{138,43,226}

definecolor{dblau}{RGB}{30,144,255}
definecolor{sblau}{RGB}{106,90,205}

definecolor{brot}{RGB}{178,34,34}
definecolor{mrot}{RGB}{128,0,0}
definecolor{pgruen}{RGB}{152,251,152}
definecolor{mgruen}{RGB}{60,179,113}
begin{document}
begin{tikzpicture}
foreach x in {0,1,...,5}
foreach y in {0,1,...,5}
{
pgfmathsetmacrorandom{int(random(1,3))}
pgfmathsetmacrorangle{random*90}
ifnumrandom=1
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
ifnumrandom=2
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
fi
ifnumrandom=3
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
}
end{tikzpicture}
end{document}


Here is the output (the look of the pattern depends on the system time):



Screenshot



My questions is: How can I achieve that I get for every second (range: 10 seconds) a seperate "frame" this pattern? Because for the random pattern the system time is used and there are changes in every minute but it is still the same "frame".



I want to get, when I convert the .pdf file into a .gif, an animation.










share|improve this question






















  • Add a loop that does nothing but taking time. Of course the loop should emd at some point. See also tex.stackexchange.com/questions/122116/…
    – TeXnician
    Nov 28 at 20:41












  • pgfmathsetseed{<integer>}?
    – marmot
    Nov 28 at 21:05










  • @marmot: I've got it, thanks!
    – current_user
    Nov 28 at 21:12

















up vote
2
down vote

favorite












Consider the following MWE:



documentclass[border=0pt,tikz]{standalone}
definecolor{elila}{RGB}{186,85,211}
definecolor{zlila}{RGB}{138,43,226}

definecolor{dblau}{RGB}{30,144,255}
definecolor{sblau}{RGB}{106,90,205}

definecolor{brot}{RGB}{178,34,34}
definecolor{mrot}{RGB}{128,0,0}
definecolor{pgruen}{RGB}{152,251,152}
definecolor{mgruen}{RGB}{60,179,113}
begin{document}
begin{tikzpicture}
foreach x in {0,1,...,5}
foreach y in {0,1,...,5}
{
pgfmathsetmacrorandom{int(random(1,3))}
pgfmathsetmacrorangle{random*90}
ifnumrandom=1
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
ifnumrandom=2
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
fi
ifnumrandom=3
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
}
end{tikzpicture}
end{document}


Here is the output (the look of the pattern depends on the system time):



Screenshot



My questions is: How can I achieve that I get for every second (range: 10 seconds) a seperate "frame" this pattern? Because for the random pattern the system time is used and there are changes in every minute but it is still the same "frame".



I want to get, when I convert the .pdf file into a .gif, an animation.










share|improve this question






















  • Add a loop that does nothing but taking time. Of course the loop should emd at some point. See also tex.stackexchange.com/questions/122116/…
    – TeXnician
    Nov 28 at 20:41












  • pgfmathsetseed{<integer>}?
    – marmot
    Nov 28 at 21:05










  • @marmot: I've got it, thanks!
    – current_user
    Nov 28 at 21:12















up vote
2
down vote

favorite









up vote
2
down vote

favorite











Consider the following MWE:



documentclass[border=0pt,tikz]{standalone}
definecolor{elila}{RGB}{186,85,211}
definecolor{zlila}{RGB}{138,43,226}

definecolor{dblau}{RGB}{30,144,255}
definecolor{sblau}{RGB}{106,90,205}

definecolor{brot}{RGB}{178,34,34}
definecolor{mrot}{RGB}{128,0,0}
definecolor{pgruen}{RGB}{152,251,152}
definecolor{mgruen}{RGB}{60,179,113}
begin{document}
begin{tikzpicture}
foreach x in {0,1,...,5}
foreach y in {0,1,...,5}
{
pgfmathsetmacrorandom{int(random(1,3))}
pgfmathsetmacrorangle{random*90}
ifnumrandom=1
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
ifnumrandom=2
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
fi
ifnumrandom=3
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
}
end{tikzpicture}
end{document}


Here is the output (the look of the pattern depends on the system time):



Screenshot



My questions is: How can I achieve that I get for every second (range: 10 seconds) a seperate "frame" this pattern? Because for the random pattern the system time is used and there are changes in every minute but it is still the same "frame".



I want to get, when I convert the .pdf file into a .gif, an animation.










share|improve this question













Consider the following MWE:



documentclass[border=0pt,tikz]{standalone}
definecolor{elila}{RGB}{186,85,211}
definecolor{zlila}{RGB}{138,43,226}

definecolor{dblau}{RGB}{30,144,255}
definecolor{sblau}{RGB}{106,90,205}

definecolor{brot}{RGB}{178,34,34}
definecolor{mrot}{RGB}{128,0,0}
definecolor{pgruen}{RGB}{152,251,152}
definecolor{mgruen}{RGB}{60,179,113}
begin{document}
begin{tikzpicture}
foreach x in {0,1,...,5}
foreach y in {0,1,...,5}
{
pgfmathsetmacrorandom{int(random(1,3))}
pgfmathsetmacrorangle{random*90}
ifnumrandom=1
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
ifnumrandom=2
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
fi
ifnumrandom=3
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
}
end{tikzpicture}
end{document}


Here is the output (the look of the pattern depends on the system time):



Screenshot



My questions is: How can I achieve that I get for every second (range: 10 seconds) a seperate "frame" this pattern? Because for the random pattern the system time is used and there are changes in every minute but it is still the same "frame".



I want to get, when I convert the .pdf file into a .gif, an animation.







tikz-pgf animations fun pattern






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 28 at 20:35









current_user

3,0561434




3,0561434












  • Add a loop that does nothing but taking time. Of course the loop should emd at some point. See also tex.stackexchange.com/questions/122116/…
    – TeXnician
    Nov 28 at 20:41












  • pgfmathsetseed{<integer>}?
    – marmot
    Nov 28 at 21:05










  • @marmot: I've got it, thanks!
    – current_user
    Nov 28 at 21:12




















  • Add a loop that does nothing but taking time. Of course the loop should emd at some point. See also tex.stackexchange.com/questions/122116/…
    – TeXnician
    Nov 28 at 20:41












  • pgfmathsetseed{<integer>}?
    – marmot
    Nov 28 at 21:05










  • @marmot: I've got it, thanks!
    – current_user
    Nov 28 at 21:12


















Add a loop that does nothing but taking time. Of course the loop should emd at some point. See also tex.stackexchange.com/questions/122116/…
– TeXnician
Nov 28 at 20:41






Add a loop that does nothing but taking time. Of course the loop should emd at some point. See also tex.stackexchange.com/questions/122116/…
– TeXnician
Nov 28 at 20:41














pgfmathsetseed{<integer>}?
– marmot
Nov 28 at 21:05




pgfmathsetseed{<integer>}?
– marmot
Nov 28 at 21:05












@marmot: I've got it, thanks!
– current_user
Nov 28 at 21:12






@marmot: I've got it, thanks!
– current_user
Nov 28 at 21:12












1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










I'll be happy to remove this (on the other hand it looks nice ;-).



documentclass[border=0pt,tikz]{standalone}
definecolor{elila}{RGB}{186,85,211}
definecolor{zlila}{RGB}{138,43,226}

definecolor{dblau}{RGB}{30,144,255}
definecolor{sblau}{RGB}{106,90,205}

definecolor{brot}{RGB}{178,34,34}
definecolor{mrot}{RGB}{128,0,0}
definecolor{pgruen}{RGB}{152,251,152}
definecolor{mgruen}{RGB}{60,179,113}
begin{document}
foreach X in {1,...,42}
{ begin{tikzpicture}
pgfmathsetseed{X}
foreach x in {0,1,...,5}
foreach y in {0,1,...,5}
{
pgfmathsetmacrorandom{int(random(1,3))}
pgfmathsetmacrorangle{random*90}
ifnumrandom=1
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
ifnumrandom=2
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
fi
ifnumrandom=3
begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
end{scope}
fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
fi
}
end{tikzpicture}}
end{document}


enter image description here






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462247%2fa-colored-pattern-but-a-little-change-to-the-random-function-in-tikz-is-required%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted










    I'll be happy to remove this (on the other hand it looks nice ;-).



    documentclass[border=0pt,tikz]{standalone}
    definecolor{elila}{RGB}{186,85,211}
    definecolor{zlila}{RGB}{138,43,226}

    definecolor{dblau}{RGB}{30,144,255}
    definecolor{sblau}{RGB}{106,90,205}

    definecolor{brot}{RGB}{178,34,34}
    definecolor{mrot}{RGB}{128,0,0}
    definecolor{pgruen}{RGB}{152,251,152}
    definecolor{mgruen}{RGB}{60,179,113}
    begin{document}
    foreach X in {1,...,42}
    { begin{tikzpicture}
    pgfmathsetseed{X}
    foreach x in {0,1,...,5}
    foreach y in {0,1,...,5}
    {
    pgfmathsetmacrorandom{int(random(1,3))}
    pgfmathsetmacrorangle{random*90}
    ifnumrandom=1
    begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
    fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
    fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
    end{scope}
    fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
    fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
    fi
    ifnumrandom=2
    begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
    fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
    fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
    end{scope}
    fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
    fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
    fi
    ifnumrandom=3
    begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
    fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
    fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
    end{scope}
    fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
    fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
    fi
    }
    end{tikzpicture}}
    end{document}


    enter image description here






    share|improve this answer

























      up vote
      4
      down vote



      accepted










      I'll be happy to remove this (on the other hand it looks nice ;-).



      documentclass[border=0pt,tikz]{standalone}
      definecolor{elila}{RGB}{186,85,211}
      definecolor{zlila}{RGB}{138,43,226}

      definecolor{dblau}{RGB}{30,144,255}
      definecolor{sblau}{RGB}{106,90,205}

      definecolor{brot}{RGB}{178,34,34}
      definecolor{mrot}{RGB}{128,0,0}
      definecolor{pgruen}{RGB}{152,251,152}
      definecolor{mgruen}{RGB}{60,179,113}
      begin{document}
      foreach X in {1,...,42}
      { begin{tikzpicture}
      pgfmathsetseed{X}
      foreach x in {0,1,...,5}
      foreach y in {0,1,...,5}
      {
      pgfmathsetmacrorandom{int(random(1,3))}
      pgfmathsetmacrorangle{random*90}
      ifnumrandom=1
      begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
      fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
      fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
      end{scope}
      fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
      fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
      fi
      ifnumrandom=2
      begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
      fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
      fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
      end{scope}
      fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
      fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
      fi
      ifnumrandom=3
      begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
      fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
      fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
      end{scope}
      fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
      fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
      fi
      }
      end{tikzpicture}}
      end{document}


      enter image description here






      share|improve this answer























        up vote
        4
        down vote



        accepted







        up vote
        4
        down vote



        accepted






        I'll be happy to remove this (on the other hand it looks nice ;-).



        documentclass[border=0pt,tikz]{standalone}
        definecolor{elila}{RGB}{186,85,211}
        definecolor{zlila}{RGB}{138,43,226}

        definecolor{dblau}{RGB}{30,144,255}
        definecolor{sblau}{RGB}{106,90,205}

        definecolor{brot}{RGB}{178,34,34}
        definecolor{mrot}{RGB}{128,0,0}
        definecolor{pgruen}{RGB}{152,251,152}
        definecolor{mgruen}{RGB}{60,179,113}
        begin{document}
        foreach X in {1,...,42}
        { begin{tikzpicture}
        pgfmathsetseed{X}
        foreach x in {0,1,...,5}
        foreach y in {0,1,...,5}
        {
        pgfmathsetmacrorandom{int(random(1,3))}
        pgfmathsetmacrorangle{random*90}
        ifnumrandom=1
        begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
        fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
        fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
        end{scope}
        fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
        fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
        fi
        ifnumrandom=2
        begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
        fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
        fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
        end{scope}
        fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
        fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
        fi
        ifnumrandom=3
        begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
        fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
        fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
        end{scope}
        fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
        fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
        fi
        }
        end{tikzpicture}}
        end{document}


        enter image description here






        share|improve this answer












        I'll be happy to remove this (on the other hand it looks nice ;-).



        documentclass[border=0pt,tikz]{standalone}
        definecolor{elila}{RGB}{186,85,211}
        definecolor{zlila}{RGB}{138,43,226}

        definecolor{dblau}{RGB}{30,144,255}
        definecolor{sblau}{RGB}{106,90,205}

        definecolor{brot}{RGB}{178,34,34}
        definecolor{mrot}{RGB}{128,0,0}
        definecolor{pgruen}{RGB}{152,251,152}
        definecolor{mgruen}{RGB}{60,179,113}
        begin{document}
        foreach X in {1,...,42}
        { begin{tikzpicture}
        pgfmathsetseed{X}
        foreach x in {0,1,...,5}
        foreach y in {0,1,...,5}
        {
        pgfmathsetmacrorandom{int(random(1,3))}
        pgfmathsetmacrorangle{random*90}
        ifnumrandom=1
        begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
        fill[brot] (0,0) -- (1,0) -- (0,1) -- cycle;
        fill[mrot] (1,0) -- (1,1) -- (0,1) -- cycle;
        end{scope}
        fill[shift={(x,y)},mrot] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
        fill[shift={(x,y)},brot] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
        fi
        ifnumrandom=2
        begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
        fill[pgruen] (0,0) -- (1,0) -- (0,1) -- cycle;
        fill[mgruen] (1,0) -- (1,1) -- (0,1) -- cycle;
        end{scope}
        fill[shift={(x,y)},mgruen] ([shift={(.5,.5)}]-135+90:.25) arc(-135+90:-135+90+180:.25);
        fill[shift={(x,y)},pgruen] ([shift={(.5,.5)}]45+90:.25) arc(45+90:45+90+180:.25);
        fi
        ifnumrandom=3
        begin{scope}[shift={(x,y)},rotate around={(rangle:(.5,.5))}]
        fill[elila] (0,0) -- (1,0) -- (0,1) -- cycle;
        fill[zlila] (1,0) -- (1,1) -- (0,1) -- cycle;
        end{scope}
        fill[shift={(x,y)},elila] ([shift={(.5,.5)}]-135:.25) arc(-135:-135+180:.25);
        fill[shift={(x,y)},zlila] ([shift={(.5,.5)}]45:.25) arc(45:45+180:.25);
        fi
        }
        end{tikzpicture}}
        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 28 at 23:28









        marmot

        81k491173




        81k491173






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462247%2fa-colored-pattern-but-a-little-change-to-the-random-function-in-tikz-is-required%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Can I use Tabulator js library in my java Spring + Thymeleaf project?