ZufallsImage

Erzeugen eines Zufallbildes in Abhängigkeit von Zufallszahlen

by Jens Kühn

HTML

<div id="canvas"></div>

JavaScript

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Rune=t()}}(function(){return function t(e,n,i){function r(a,o){if(!n[a]){if(!e[a]){var h="function"==typeof require&&require;if(!o&&h)return h(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return r(n?n:t)},c,c.exports,t,e,n,i)}return n[a].exports}for(var s="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(t,e,n){},{}],2:[function(t,e,n){function i(t){var e,n,i,r=t[0]/255,s=t[1]/255,a=t[2]/255,o=Math.min(r,s,a),h=Math.max(r,s,a),u=h-o;return h==o?e=0:r==h?e=(s-a)/u:s==h?e=2+(a-r)/u:a==h&&(e=4+(r-s)/u),e=Math.min(60*e,360),0>e&&(e+=360),i=(o+h)/2,n=h==o?0:.5>=i?u/(h+o):u/(2-h-o),[e,100*n,100*i]}function s(t){var e,n,i,r=t[0],s=t[1],a=t[2],o=Math.min(r,s,a),h=Math.max(r,s,a),u=h-o;return n=0==h?0:u/h*1e3/10,h==o?e=0:r==h?e=(s-a)/u:s==h?e=2+(a-r)/u:a==h&&(e=4+(r-s)/u),e=Math.min(60*e,360),0>e&&(e+=360),i=h/255*1e3/10,[e,n,i]}function a(t){var e=t[0],n=t[1],r=t[2],s=i(t)[0],a=1/255*Math.min(e,Math.min(n,r)),r=1-1/255*Math.max(e,Math.max(n,r));return[s,100*a,100*r]}function o(t){var e,n,i,r,s=t[0]/255,a=t[1]/255,o=t[2]/255;return r=Math.min(1-s,1-a,1-o),e=(1-s-r)/(1-r)||0,n=(1-a-r)/(1-r)||0,i=(1-o-r)/(1-r)||0,[100*e,100*n,100*i,100*r]}function h(t){return $[JSON.stringify(t)]}function u(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var r=.4124*e+.3576*n+.1805*i,s=.2126*e+.7152*n+.0722*i,a=.0193*e+.1192*n+.9505*i;return[100*r,100*s,100*a]}function c(t){var e,n,i,r=u(t),s=r[0],a=r[1],o=r[2];return...