Moderne Kunst

Wie zegt dat je geen kunst met computers kan maken liegt. Het kan nu zelfs op een web pagina.

<HTML>
<BODY>
<br>
<br>
<!– Tekengebied met een vierkant met zwarte rand erin –>
<canvas id=”myCanvas” width=”1000″ height=”800″>
</canvas>
<SCRIPT>
var TekenOppervlak = document.getElementById(“myCanvas”);
var TekenVlak = TekenOppervlak.getContext(“2d”);
var Xpos = 100;
var Ypos = 200;
var Breedte = 400;
var Hoogte = 400;
var teller = 0;
var color1 = “#000000”;
var color2 = “#000000”;
var Rood = “”;
var Groen= “”;
var Blauw = “”;
var KleurIndex = 0;
var TotaalBlokken =  Math.floor(Math.random() * 100) + 1;
while (teller<TotaalBlokken){
<!– Krimpend Vierkant –>
Breedte= Math.floor(Math.random() * 600);
Hoogte= Math.floor(Math.random() * 500);
Xpos = Math.floor(Math.random() * 700);
Ypos = Math.floor(Math.random() * 500);
KleurIndex = Math.floor(Math.random() * 255);
Rood = KleurIndex.toString(16);
KleurIndex = Math.floor(Math.random() * 255);
Groen = KleurIndex.toString(16);
KleurIndex = Math.floor(Math.random() * 255);
Blauw = KleurIndex.toString(16);
color1 = “#” + Rood + Groen + Blauw;<!– Construct HTML RGB color –>
KleurIndex = Math.floor(Math.random() * 255);
Rood = KleurIndex.toString(16);
KleurIndex = Math.floor(Math.random() * 255);
Groen = KleurIndex.toString(16);
KleurIndex = Math.floor(Math.random() * 255);
Blauw = KleurIndex.toString(16);
color2 = “#” + Rood + Groen + Blauw;<!– Construct HTML RGB color –>
<!– make sure color sring is # plus six characters, so total of 7 … –>
while (color1.length < 7) {color1 = color1 + “0”}
if (color1.length > 7) {color1 = color1.substring(0, 7)}
while (color2.length < 7) {color2 = color2 + “0”}
if (color2.length > 7) {color1 = color2.substring(0, 7)}
var BlockFill = TekenVlak.createLinearGradient(Xpos,Ypos,Xpos + Breedte,Ypos + Hoogte);
BlockFill.addColorStop(0,color1);
BlockFill.addColorStop(1,color2);
TekenVlak.fillStyle = BlockFill;
TekenVlak.lineWidth = 1.0;
TekenVlak.fillRect(Xpos,Ypos,Breedte,Hoogte);
TekenVlak.stroke();
teller++;
}
</SCRIPT>
<br>
<div align=”right” width=”1000″>&copy; H.L. Muller 2016</div>
</BODY>
</HTML>
You can leave a response, or trackback from your own site.

Leave a Reply