         depthPixelIndex += 2;
          }
          ctx.putImageData(canvasImageData, 0, 0);
        };

        const map = (value, inputMin, inputMax, outputMin, outputMax) => {
          return (value - inputMin) * (outputMax - outputMin) / (inputMax - inputMin) + outputMin;
        };

        /**
         * https://gist.github.com/mjackson/5311256
         * Converts an HSV color value to RGB. Conversion formula
         * adapted from http://en.wikipedia.org/wiki/HSV_color_space.
         * Assumes h