diff --git a/src/js/worker/framecolors/FrameColorsWorker.js b/src/js/worker/framecolors/FrameColorsWorker.js index 45a79479..65a87a2d 100644 --- a/src/js/worker/framecolors/FrameColorsWorker.js +++ b/src/js/worker/framecolors/FrameColorsWorker.js @@ -9,6 +9,15 @@ var TRANSPARENT_COLOR = 'rgba(0, 0, 0, 0)'; + var componentToHex = function (c) { + var hex = c.toString(16); + return hex.length == 1 ? '0' + hex : hex; + }; + + var rgbToHex = function (r, g, b) { + return '#' + componentToHex(r) + componentToHex(g) + componentToHex(b); + }; + var toHexString_ = function(color) { if (color === TRANSPARENT_COLOR) { return color; @@ -25,15 +34,6 @@ } }; - var rgbToHex = function (r, g, b) { - return '#' + componentToHex(r) + componentToHex(g) + componentToHex(b); - }; - - var componentToHex = function (c) { - var hex = c.toString(16); - return hex.length == 1 ? '0' + hex : hex; - }; - var getFrameColors = function (frame) { var frameColors = {}; for (var x = 0 ; x < frame.length ; x++) { diff --git a/src/js/worker/imageprocessor/ImageProcessorWorker.js b/src/js/worker/imageprocessor/ImageProcessorWorker.js index 1abb7d81..8b6fb72b 100644 --- a/src/js/worker/imageprocessor/ImageProcessorWorker.js +++ b/src/js/worker/imageprocessor/ImageProcessorWorker.js @@ -24,15 +24,15 @@ } }; - var rgbToHex = function (r, g, b) { - return '#' + componentToHex(r) + componentToHex(g) + componentToHex(b); - }; - var componentToHex = function (c) { var hex = c.toString(16); return hex.length == 1 ? '0' + hex : hex; }; + var rgbToHex = function (r, g, b) { + return '#' + componentToHex(r) + componentToHex(g) + componentToHex(b); + }; + var imageDataToGrid = function (imageData, width, height, transparent) { // Draw the zoomed-up pixels to a different canvas context var grid = [];