From f650127c109fb65a589388cefb51eb990b151612 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 6 May 2015 01:57:11 -0400 Subject: experimental palette --- js/blit.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'js/blit.js') diff --git a/js/blit.js b/js/blit.js index ac8cb42..367d67b 100644 --- a/js/blit.js +++ b/js/blit.js @@ -47,5 +47,22 @@ var blit = (function(){ } }) } + blit.circle = function(A, lex){ + var hw = brush.w/2|0, hh = brush.h/2|0 + A.forEach(function(lex,x,y) { + var len = Math.sqrt(Math.pow(x-hw,2)+Math.pow(y-hh,2)) + if (len > Math.abs(hw)) { + lex.clear() + } + }) + } + blit.cross = function(A, lex){ + A.forEach(function(lex,x,y) { + if ((x+y)%2) { + lex.clear() + } + }) + } + return blit })() -- cgit v1.2.3-70-g09d2