A robust version of getColorAt() that uses a canvas trick. We apply the gradient to a hidden canvas and query the pixel color with the canvas.getImageData() function. See here for a basic computational version. See here for a robust computational version. The selected circle is filled with getColorAt(...) on mouse movement. Hold shift to change the highlight location.
Allowsstops to be in random order
Allowsfor unspecified offsets (notice red and green)
Allowsa radial highlight (paper gradient) or inner circle (canvas gradient)
No comments:
Post a Comment