All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gwt.material.design.addins.client.avatar.resources.js.jdenticon-1.3.2.min.js Maven / Gradle / Ivy

There is a newer version: 2.8.3
Show newest version
// Jdenticon 1.3.2 | jdenticon.com | zlib licensed | (c) 2014-2015 Daniel Mester Pirttijärvi
(function(k,g,h){var l=h(k,k.jQuery);"undefined"!==typeof module&&"exports"in module?module.exports=l:"function"===typeof define&&define.amd?define([],function(){return l}):k[g]=l})(this,"jdenticon",function(k,g){function h(b,a){this.x=b;this.y=a}function l(b,a,c,d){this.o=b;this.s=a;this.f=c;this.l=d}function A(b){this.C=b;this.m=l.O}function m(b){b|=0;return 0>b?"00":16>b?"0"+b.toString(16):256>b?b.toString(16):"ff"}function q(b,a,c){c=0>c?c+6:6c?b+(a-b)*c:3>c?a:4>c?b+(a-
b)*(4-c):b))}function D(b,a){return[n.w(0,0,a.H(0)),n.v(b,a.A,a.u(.5)),n.w(0,0,a.H(1)),n.v(b,a.A,a.u(1)),n.v(b,a.A,a.u(0))]}function r(b,a,c,d,t){var f=0,u=0;function v(c,d,t,e,g){e=e?parseInt(a.charAt(e),16):0;d=d[parseInt(a.charAt(t),16)%d.length];b.F(n[m[c]]);for(c=0;cc)throw Error("Jdenticon cannot render identicons smaller than 30 pixels.");
if(!/^[0-9a-f]{11,}$/i.test(a))throw Error("Invalid hash passed to Jdenticon.");var k=new A(b),h=0|c/4,f=f+(0|d+c/2-2*h),u=u+(0|d+c/2-2*h),n=D(parseInt(a.substr(-7),16)/268435455,t),m=[],g;for(c=0;3>c;c++){g=parseInt(a.charAt(8+c),16)%n.length;if(e([0,4])||e([2,3]))g=1;m.push(g)}v(0,w.J,2,3,[[1,0],[2,0],[2,3],[1,3],[0,1],[3,1],[3,2],[0,2]]);v(1,w.J,4,5,[[0,0],[3,0],[3,3],[0,3]]);v(2,w.N,1,null,[[1,1],[2,1],[2,2],[1,2]])}function B(){this.i=""}function x(b,a){this.j={};this.f={M:b,I:a}}function y(b,
a,c){this.h=b;b.clearRect(0,0,a,c)}function z(){function b(a,b,f){var e=c[a]instanceof Array?c[a]:[b,f];return function(a){a=e[0]+a*(e[1]-e[0]);return 0>a?0:1=c?c*(a+1):c+a-c*a;c=2*c-a;return"#"+q(c,a,6*b+2)+q(c,a,6*b)+q(c,a,6*b-2)},v:function(b,a,c){var d=[.55,.5,.5,.46,.6,.55,.55][6*b+.5|0];return n.w(b,a,.5>c?c*d*2:d+(c-.5)*(1-d)*2)}};B.prototype={a:function(b){for(var a="M"+b[0].x+" "+b[0].y,c=1;c<
b.length;c++)a+="L"+b[c].x+" "+b[c].y;this.i+=a+"Z"},b:function(b,a,c){c=c?0:1;var d=a/2;this.i+="M"+b.x+" "+(b.y+d)+"a"+d+","+d+" 0 1,"+c+" "+a+",0a"+d+","+d+" 0 1,"+c+" "+-a+",0"}};x.prototype={F:function(b){this.B=this.j[b]||(this.j[b]=new B)},G:function(){},a:function(b){this.B.a(b)},b:function(b,a,c){this.B.b(b,a,c)},K:function(b){var a=b?"":'',
c;for(c in this.j)a+='';return b?a:a+""}};y.prototype={F:function(b){this.h.fillStyle=b;this.h.beginPath()},G:function(){this.h.fill()},a:function(b){var a=this.h,c;a.moveTo(b[0].x,b[0].y);for(c=1;c




© 2015 - 2024 Weber Informatics LLC | Privacy Policy