diff --git a/main.js b/main.js index fdd4e8c..e808c30 100644 --- a/main.js +++ b/main.js @@ -9,3 +9,13 @@ const targetColor = config.targetColor; const tolerance = config.tolerance; + +function rasterize(x, y, width){ //scale to image + return (x + y * width); +} +function deRasterize(i, width){ + return ({ + y: Math.floor(i/width), + x: i % width + }); +}