New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

infinite-turtles

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infinite-turtles - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

karma.conf.js

8

dist/color.js

@@ -19,6 +19,6 @@ (function() {

function Color(r1, g1, b1, opacity) {
this.r = r1;
this.g = g1;
this.b = b1;
this.opacity = opacity != null ? opacity : 1;
this.r = r1 != null ? r1 : 0;
this.g = g1 != null ? g1 : 0;
this.b = b1 != null ? b1 : 0;
this.opacity = opacity != null ? opacity : 1.0;
this;

@@ -25,0 +25,0 @@ }

@@ -1,1 +0,1 @@

(function(){var t,r=function(t,r){return function(){return t.apply(r,arguments)}},o=function(t,r){function o(){this.constructor=t}for(var n in r)i.call(r,n)&&(t[n]=r[n]);return o.prototype=r.prototype,t.prototype=new o,t.__super__=r.prototype,t},i={}.hasOwnProperty,n=[].slice;t=function(t){return"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define([],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.Color=t())},t(function(){var t;return t=t=function(){function t(t,r,o,i){this.r=t,this.g=r,this.b=o,this.opacity=null!=i?i:1}return t.prototype.toString=function(){return"rgba("+this.r+","+this.g+","+this.b+","+this.opacity+")"},t.prototype.setHue=function(t){var r;return t>360&&(t%=360),r=this.toHSL(),r.H=t,this.fromHSL(r.H,r.S,r.L)},t.prototype.getHue=function(){return this.toHSL().H},t.prototype.toHSL=function(){var t,r,o,i,n,e,s,h,u,a,f,c;return c=this.r/255,u=this.g/255,i=this.b/255,a=Math.max(c,u,i),f=Math.min(c,u,i),n=a-f,r=(a+f)/2,0===n?(t=0,o=0):(o=.5>r?n/(a+f):n/(2-a-f),h=((a-c)/6+n/2)/n,s=((a-u)/6+n/2)/n,e=((a-i)/6+n/2)/n,c===a?t=e-s:u===a?t=1/3+h-e:i===a&&(t=2/3+s-h)),0>t&&(t+=1),t>1&&(t-=1),{H:360*t,S:100*o,L:100*r}},t.prototype.fromHSL=function(t,r,o){var i,n,e;return i=function(t,r,o){return 0>o&&(o+=1),o>1&&(o-=1),1>6*o?t+6*(r-t)*o:1>2*o?r:2>3*o?t+(r-t)*(2/3-o)*6:t},t/=360,r/=100,o/=100,0===r?(this.r=255*o,this.g=255*o,this.b=255*o):(e=.5>o?o*(1+r):o+r-r*o,n=2*o-e,this.r=255*i(n,e,t+1/3),this.g=255*i(n,e,t),this.b=255*i(n,e,t-1/3)),[this.r,this.g,this.b]},t}()}),t=function(t){return"object"==typeof exports?module.exports=t(require("../color")):"function"==typeof define&&define.amd?define(["color"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.TurtleDrawer=t(this.TURTLE.Color))},t(function(t){var o;return o=function(){function o(t){this.canvas=t,this.lineWidth=r(this.lineWidth,this),this.forward=r(this.forward,this),this.ctx=this.canvas.getContext("2d")}return o.prototype.angle=0,o.prototype.x=800,o.prototype.y=200,o.prototype._color=new t(0,0,0,1),o.prototype._lineWidth=1,o.prototype.finish=function(){},o.prototype.forward=function(t,r){return this.ctx.beginPath(),this.ctx.moveTo(this.x,this.y),this.ctx.lineWidth=this._lineWidth,this.ctx.strokeStyle=this._color.toString(),this.x+=(t+r)*Math.cos(this.angle*(Math.PI/180)),this.y+=(t+r)*Math.sin(this.angle*(Math.PI/180)),this.ctx.lineTo(this.x,this.y),this.ctx.stroke(),this},o.prototype.color=function(t){return this._color=t,this},o.prototype.moveX=function(t,r){return null==r&&(r=0),this.x+=t+r,this},o.prototype.moveY=function(t,r){return null==r&&(r=0),this.y+=t+r,this},o.prototype.setX=function(t,r){return null==r&&(r=0),this.x=t+r,this},o.prototype.setY=function(t,r){return null==r&&(r=0),this.y=t+r,this},o.prototype.lineWidth=function(t,r){return null==r&&(r=0),this._lineWidth=t+r,this},o.prototype.turn=function(t,r){return this.angle+=t-1+r,this},o}()}),t=function(t){return"object"==typeof exports?module.exports=t(require("./drawers/turtle-drawer")):"function"==typeof define&&define.amd?define(["turtle-drawer"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.Turtle=t(this.TURTLE.TurtleDrawer))},t(function(t){var o;return o=function(){function o(o){this.canvas=o,this.keepDrawing=r(this.keepDrawing,this),this.doDraw=r(this.doDraw,this),this.draw=r(this.draw,this),this.job=r(this.job,this),this.ctx=this.canvas.getContext("2d"),this.ctx.globalCompositeOperation="source-over",this.drawer=new t(this.canvas),this.commands=[]}return o.prototype.setBlendMode=function(t){return this.ctx.globalCompositeOperation=t},o.prototype.background=function(t){var r,o;return o=this.canvas.width,r=this.canvas.height,this.ctx.fillStyle=t,this.ctx.fillRect(0,0,o,r)},o.prototype.job=function(t){var r,o;return o=this,new(r=function(){function t(t){this.fn=t}return t.prototype.before=function(){},t.prototype.run=function(){return this.beforeEach.apply(o),this.fn.apply(o)},t}())(t)},o.prototype.forward=function(t,r){return null==r&&(r=0),this.commands.push({fn:this.drawer.forward,args:t,mod:r}),this},o.prototype.turn=function(t,r){return null==r&&(r=0),this.commands.push({fn:this.drawer.turn,args:t,mod:r}),this},o.prototype.color=function(t,r){return this.commands.push({fn:this.drawer.color,args:t,mod:r}),this},o.prototype.lineWidth=function(t,r){return this.commands.push({fn:this.drawer.lineWidth,args:t,mod:r}),this},o.prototype.moveX=function(t,r){return this.commands.push({fn:this.drawer.moveX,args:t,mod:r}),this},o.prototype.moveY=function(t,r){return this.commands.push({fn:this.drawer.moveY,args:t,mod:r}),this},o.prototype.setX=function(t,r){return this.commands.push({fn:this.drawer.setX,args:t,mod:r}),this},o.prototype.setY=function(t,r){return this.commands.push({fn:this.drawer.setY,args:t,mod:r}),this},o.prototype.draw=function(t){return this.n=0,this.drawing=!0,t?this.doDraw(t):this.keepDrawing()},o.prototype.stop=function(){return this.drawing=!1,this.drawer.finish()},o.prototype.doDraw=function(t){var r,o,i,n,e,s,h,u;for(o=i=1,h=t;h>=1?h>=i:i>=h;o=h>=1?++i:--i)for(u=this.commands,n=0,e=u.length;e>n;n++)r=u[n],"number"==typeof r.mod?(s=r.mod?r.mod*o:1,r.fn.apply(this.drawer,[r.args,s])):"function"==typeof r.mod?r.fn.apply(this.drawer,[r.args,r.mod(o)]):r.fn.apply(this.drawer,[r.args]);return this.stop()},o.prototype.keepDrawing=function(){var t,r,o,i,n,e,s;if(this.drawing){for(r=o=0;10>=o;r=++o)for(this.n=this.n+1,s=this.commands,i=0,n=s.length;n>i;i++)t=s[i],"number"==typeof t.mod?(e=t.mod?t.mod*this.n:1,t.fn.apply(this.drawer,[t.args,e])):"function"==typeof t.mod?t.fn.apply(this.drawer,[t.args,t.mod(this.n)]):t.fn.apply(this.drawer,[t.args]);return window.requestAnimationFrame(function(t){return function(){return t.keepDrawing()}}(this)),this}},o.prototype.finish=function(){return this.drawer.finish(),this},o.blendMode={NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten","COLOR-DODGE":"color-dodge","COLOR-BURN":"color-burn","HARD-LIGHT":"hard-light","SOFT-LIGHT":"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"},o}()}),(t=function(t){return"object"==typeof exports?module.exports=t(require("../color","turtle-drawer")):"function"==typeof define&&define.amd?define(["color","turtle-drawer"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.OffsetColorDrawer=t(this.TURTLE.Color,this.TURTLE.TurtleDrawer))})(function(t,r){var i;return i=function(i){function e(o){var i,e,s,h,u;for(this.offsetX=30,this.offsetY=30,this.drawers=[],e=s=0;2>=s;e=s+=1)this.drawers[e]=new r(o);u=new r(o);for(h in u)i=u[h],"function"==typeof i&&!function(t){return function(r){return t[r]=function(){var t,o,i,e,s,h;for(t=1<=arguments.length?n.call(arguments,0):[],s=this.drawers,h=[],i=0,e=s.length;e>i;i++)o=s[i],h.push(function(o){return o[r].apply(o,t)}(o));return h}}}(this)(h,i);this.color=function(r){return this._color=r,this.drawers[0].color(new t(this._color.r,0,0,this._color.opacity/3)),this.drawers[1].color(new t(0,this._color.g,0,this._color.opacity/3)),this.drawers[2].color(new t(0,0,this._color.b,this._color.opacity/3)),this},this.setX=function(t,r){return null==r&&(r=0),this.drawers[0].setX(t,r),this.drawers[1].setX(t+this.offsetX,r),this.drawers[2].setX(t+2*this.offsetX,r),this},this.moveX=function(t,r){return null==r&&(r=0),this.drawers[0].moveX(t,r),this.drawers[1].moveX(t+this.offsetX,r),this.drawers[2].moveX(t+2*this.offsetX,r),this},this.setY=function(t,r){return null==r&&(r=0),this.drawers[0].setY(t,r),this.drawers[1].setY(t+this.offsetY,r),this.drawers[2].setY(t+2*this.offsetY,r),this},this.moveY=function(t,r){return null==r&&(r=0),this.drawers[0].moveY(t,r),this.drawers[1].moveY(t+this.offsetY,r),this.drawers[2].moveY(t+2*this.offsetY,r),this}}return o(e,i),e}(r)})}).call(this);
(function(){var t,r=function(t,r){return function(){return t.apply(r,arguments)}},o=function(t,r){function o(){this.constructor=t}for(var n in r)i.call(r,n)&&(t[n]=r[n]);return o.prototype=r.prototype,t.prototype=new o,t.__super__=r.prototype,t},i={}.hasOwnProperty,n=[].slice;t=function(t){return"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define([],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.Color=t())},t(function(){var t;return t=t=function(){function t(t,r,o,i){this.r=null!=t?t:0,this.g=null!=r?r:0,this.b=null!=o?o:0,this.opacity=null!=i?i:1}return t.prototype.toString=function(){return"rgba("+this.r+","+this.g+","+this.b+","+this.opacity+")"},t.prototype.setHue=function(t){var r;return t>360&&(t%=360),r=this.toHSL(),r.H=t,this.fromHSL(r.H,r.S,r.L)},t.prototype.getHue=function(){return this.toHSL().H},t.prototype.toHSL=function(){var t,r,o,i,n,e,s,h,u,a,f,c;return c=this.r/255,u=this.g/255,i=this.b/255,a=Math.max(c,u,i),f=Math.min(c,u,i),n=a-f,r=(a+f)/2,0===n?(t=0,o=0):(o=.5>r?n/(a+f):n/(2-a-f),h=((a-c)/6+n/2)/n,s=((a-u)/6+n/2)/n,e=((a-i)/6+n/2)/n,c===a?t=e-s:u===a?t=1/3+h-e:i===a&&(t=2/3+s-h)),0>t&&(t+=1),t>1&&(t-=1),{H:360*t,S:100*o,L:100*r}},t.prototype.fromHSL=function(t,r,o){var i,n,e;return i=function(t,r,o){return 0>o&&(o+=1),o>1&&(o-=1),1>6*o?t+6*(r-t)*o:1>2*o?r:2>3*o?t+(r-t)*(2/3-o)*6:t},t/=360,r/=100,o/=100,0===r?(this.r=255*o,this.g=255*o,this.b=255*o):(e=.5>o?o*(1+r):o+r-r*o,n=2*o-e,this.r=255*i(n,e,t+1/3),this.g=255*i(n,e,t),this.b=255*i(n,e,t-1/3)),[this.r,this.g,this.b]},t}()}),t=function(t){return"object"==typeof exports?module.exports=t(require("../color")):"function"==typeof define&&define.amd?define(["color"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.TurtleDrawer=t(this.TURTLE.Color))},t(function(t){var o;return o=function(){function o(t){this.canvas=t,this.lineWidth=r(this.lineWidth,this),this.forward=r(this.forward,this),this.ctx=this.canvas.getContext("2d")}return o.prototype.angle=0,o.prototype.x=800,o.prototype.y=200,o.prototype._color=new t(0,0,0,1),o.prototype._lineWidth=1,o.prototype.finish=function(){},o.prototype.forward=function(t,r){return this.ctx.beginPath(),this.ctx.moveTo(this.x,this.y),this.ctx.lineWidth=this._lineWidth,this.ctx.strokeStyle=this._color.toString(),this.x+=(t+r)*Math.cos(this.angle*(Math.PI/180)),this.y+=(t+r)*Math.sin(this.angle*(Math.PI/180)),this.ctx.lineTo(this.x,this.y),this.ctx.stroke(),this},o.prototype.color=function(t){return this._color=t,this},o.prototype.moveX=function(t,r){return null==r&&(r=0),this.x+=t+r,this},o.prototype.moveY=function(t,r){return null==r&&(r=0),this.y+=t+r,this},o.prototype.setX=function(t,r){return null==r&&(r=0),this.x=t+r,this},o.prototype.setY=function(t,r){return null==r&&(r=0),this.y=t+r,this},o.prototype.lineWidth=function(t,r){return null==r&&(r=0),this._lineWidth=t+r,this},o.prototype.turn=function(t,r){return this.angle+=t-1+r,this},o}()}),t=function(t){return"object"==typeof exports?module.exports=t(require("./drawers/turtle-drawer")):"function"==typeof define&&define.amd?define(["turtle-drawer"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.Turtle=t(this.TURTLE.TurtleDrawer))},t(function(t){var o;return o=function(){function o(o){this.canvas=o,this.keepDrawing=r(this.keepDrawing,this),this.doDraw=r(this.doDraw,this),this.draw=r(this.draw,this),this.job=r(this.job,this),this.ctx=this.canvas.getContext("2d"),this.ctx.globalCompositeOperation="source-over",this.drawer=new t(this.canvas),this.commands=[]}return o.prototype.setBlendMode=function(t){return this.ctx.globalCompositeOperation=t},o.prototype.background=function(t){var r,o;return o=this.canvas.width,r=this.canvas.height,this.ctx.fillStyle=t,this.ctx.fillRect(0,0,o,r)},o.prototype.job=function(t){var r,o;return o=this,new(r=function(){function t(t){this.fn=t}return t.prototype.before=function(){},t.prototype.run=function(){return this.beforeEach.apply(o),this.fn.apply(o)},t}())(t)},o.prototype.forward=function(t,r){return null==r&&(r=0),this.commands.push({fn:this.drawer.forward,args:t,mod:r}),this},o.prototype.turn=function(t,r){return null==r&&(r=0),this.commands.push({fn:this.drawer.turn,args:t,mod:r}),this},o.prototype.color=function(t,r){return this.commands.push({fn:this.drawer.color,args:t,mod:r}),this},o.prototype.lineWidth=function(t,r){return this.commands.push({fn:this.drawer.lineWidth,args:t,mod:r}),this},o.prototype.moveX=function(t,r){return this.commands.push({fn:this.drawer.moveX,args:t,mod:r}),this},o.prototype.moveY=function(t,r){return this.commands.push({fn:this.drawer.moveY,args:t,mod:r}),this},o.prototype.setX=function(t,r){return this.commands.push({fn:this.drawer.setX,args:t,mod:r}),this},o.prototype.setY=function(t,r){return this.commands.push({fn:this.drawer.setY,args:t,mod:r}),this},o.prototype.draw=function(t){return this.n=0,this.drawing=!0,t?this.doDraw(t):this.keepDrawing()},o.prototype.stop=function(){return this.drawing=!1,this.drawer.finish()},o.prototype.doDraw=function(t){var r,o,i,n,e,s,h,u;for(o=i=1,h=t;h>=1?h>=i:i>=h;o=h>=1?++i:--i)for(u=this.commands,n=0,e=u.length;e>n;n++)r=u[n],"number"==typeof r.mod?(s=r.mod?r.mod*o:1,r.fn.apply(this.drawer,[r.args,s])):"function"==typeof r.mod?r.fn.apply(this.drawer,[r.args,r.mod(o)]):r.fn.apply(this.drawer,[r.args]);return this.stop()},o.prototype.keepDrawing=function(){var t,r,o,i,n,e,s;if(this.drawing){for(r=o=0;10>=o;r=++o)for(this.n=this.n+1,s=this.commands,i=0,n=s.length;n>i;i++)t=s[i],"number"==typeof t.mod?(e=t.mod?t.mod*this.n:1,t.fn.apply(this.drawer,[t.args,e])):"function"==typeof t.mod?t.fn.apply(this.drawer,[t.args,t.mod(this.n)]):t.fn.apply(this.drawer,[t.args]);return window.requestAnimationFrame(function(t){return function(){return t.keepDrawing()}}(this)),this}},o.prototype.finish=function(){return this.drawer.finish(),this},o.blendMode={NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten","COLOR-DODGE":"color-dodge","COLOR-BURN":"color-burn","HARD-LIGHT":"hard-light","SOFT-LIGHT":"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"},o}()}),(t=function(t){return"object"==typeof exports?module.exports=t(require("../color","turtle-drawer")):"function"==typeof define&&define.amd?define(["color","turtle-drawer"],t):(this.TURTLE=this.TURTLE||{},this.TURTLE.OffsetColorDrawer=t(this.TURTLE.Color,this.TURTLE.TurtleDrawer))})(function(t,r){var i;return i=function(i){function e(o){var i,e,s,h,u;for(this.offsetX=30,this.offsetY=30,this.drawers=[],e=s=0;2>=s;e=s+=1)this.drawers[e]=new r(o);u=new r(o);for(h in u)i=u[h],"function"==typeof i&&!function(t){return function(r){return t[r]=function(){var t,o,i,e,s,h;for(t=1<=arguments.length?n.call(arguments,0):[],s=this.drawers,h=[],i=0,e=s.length;e>i;i++)o=s[i],h.push(function(o){return o[r].apply(o,t)}(o));return h}}}(this)(h,i);this.color=function(r){return this._color=r,this.drawers[0].color(new t(this._color.r,0,0,this._color.opacity/3)),this.drawers[1].color(new t(0,this._color.g,0,this._color.opacity/3)),this.drawers[2].color(new t(0,0,this._color.b,this._color.opacity/3)),this},this.setX=function(t,r){return null==r&&(r=0),this.drawers[0].setX(t,r),this.drawers[1].setX(t+this.offsetX,r),this.drawers[2].setX(t+2*this.offsetX,r),this},this.moveX=function(t,r){return null==r&&(r=0),this.drawers[0].moveX(t,r),this.drawers[1].moveX(t+this.offsetX,r),this.drawers[2].moveX(t+2*this.offsetX,r),this},this.setY=function(t,r){return null==r&&(r=0),this.drawers[0].setY(t,r),this.drawers[1].setY(t+this.offsetY,r),this.drawers[2].setY(t+2*this.offsetY,r),this},this.moveY=function(t,r){return null==r&&(r=0),this.drawers[0].moveY(t,r),this.drawers[1].moveY(t+this.offsetY,r),this.drawers[2].moveY(t+2*this.offsetY,r),this}}return o(e,i),e}(r)})}).call(this);

@@ -8,3 +8,3 @@

umd = require('gulp-umd'),
karma = require('karma').server;
paths = {

@@ -17,7 +17,16 @@ coffeescripts: ['src/color.coffee', 'src/drawers/turtle-drawer.coffee', 'src/turtle.coffee','src/**/*.coffee']

gulp.task('clean', function () {
return gulp.src('dist/**/*.js', {read: false})
.pipe(clean());
'use strict';
return gulp.src('dist/**/*.js', {read: false})
.pipe(clean());
});
gulp.task('test', function(done) {
'use strict';
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
gulp.task('coffeescripts', function() {

@@ -36,6 +45,4 @@ // Minify and copy all JavaScript (except vendor scripts)

return gulp.src('./src/**/*.coffee')
.pipe(coffee())
.pipe(coffee())
//.pipe(umd())
.pipe(gulp.dest('dist'));

@@ -52,2 +59,2 @@ });

// The default task (called when you run `gulp` from cli)
gulp.task('default', ['clean', 'coffeescripts', 'build']);
gulp.task('default', ['clean', 'coffeescripts', 'build', 'test']);
{
"name": "infinite-turtles",
"version": "0.1.9",
"version": "0.1.10",
"description": "Turtle drawing library",

@@ -26,4 +26,15 @@ "main": "index.js",

"gulp-uglify": "^1.1.0",
"gulp-umd": "^0.1.3"
"gulp-umd": "^0.1.3",
"jasmine-core": "^2.2.0",
"karma": "^0.12.31",
"karma-jasmine": "^0.3.5",
"jasmine": "^2.2.1",
"jasmine-core": "^2.2.0",
"karma-chrome-launcher": "^0.1.7",
"karma-coverage": "^0.2.7",
"karma-jasmine": "^0.2.2",
"karma-junit-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^0.1.4",
"karma-spec-reporter": "0.0.16"
}
}

@@ -45,5 +45,5 @@ Infinite turtles

[More examples on y tumblr blog](http://electronicsweetsfun.tumblr.com/)
![Example image](https://41.media.tumblr.com/46531a0a9fad9f2f3391365e19d6fd68/tumblr_nml0ck3xEv1usyfwwo1_540.jpg "")

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc