let TOP=1,RIGHT=2,BOTTOM=3,LEFT=4,TOP_RIGHT=5,BOTTOM_RIGHT=6,BOTTOM_LEFT=7,TOP_LEFT=8;function collisionDetection(a,e){let j=strokePadding;if(null==j&&(j=0),a.isEllipse&&e.isRectangle){let k=a,l=e;for(let n=0;nD&&zE&&AD&&uk.v.y)return{isTouching:!0,location:BOTTOM}}if(w>E&&wk.v.x)return{isTouching:!0,location:RIGHT}}if(0PI/2&&n<=PI)return{isTouching:!0,location:TOP_LEFT};if(n>PI&&n<=PI+PI/2)return{isTouching:!0,location:TOP_RIGHT};if(n>PI+PI/2&&n<=TWO_PI)return{isTouching:!0,location:BOTTOM_RIGHT}}}}if(a.isEllipse&&e.isEllipse){let k=a,l=e;if(k.x+k.r>l.x-l.r&&k.x-k.rl.y-l.r&&k.y-k.rj.length&&(j="0"+j),2>k.length&&(k="0"+k),2>l.length&&(l="0"+l),2>n.length&&(n="0"+n)}else{let l=floor(a/100/60%60)+"";2>j.length&&(j="0"+j),2>k.length&&(k="0"+k),2>l.length&&(l="0"+l)}return timeString}function setCookie(a,e,j){let k="";if(j){let l=new Date;l.setTime(l.getTime()+1e3*(60*(60*(24*(365*j))))),k="; expires="+l.toUTCString()}document.cookie=a+"="+e+k+"; path=/"}function getCookie(a){let e=a+"=",j=document.cookie.split(";");for(let l,k=0;k$("#saturation").width()+6&&e<$("#saturation").width()+6+$("#hue").width()&&0e.height()?j.css("top",e.height()-1):0>k&&j.css("top",-1)}if("sb"==this.movingObject){let e=$("#saturation"),j=$("#value"),k=$("#sb_picker"),l=winMouseX-e.offset().left,n=winMouseY-j.offset().top;0l?k.css("left",-8):ln?k.css("top",-8):n>j.height()&&k.css("top",j.height()-8)}this.updateFromGraphical()},this.mouseReleased=function(){this.movingObject=""},this.getColor=function(){return this.hex}}function fontColor(a){let e=Math.round((299*red(a)+587*green(a)+114*blue(a))/1e3);return 125