the image to fit the gradient to Will be scaled down to at most 32x32. Must be loaded/complete.
a string that can be used as a css gradient
Fits a linear gradient to image data
the image data to fit the gradient to.
a string that can be used as a css gradient.
Extract representative colors from an image.
the image to extract the palette from. Must be loaded/complete.
upper limit on the number of colors to be returned
if true the image will be downscaled to 64x64, 128x128 otherwise. The precise sizes used may change in the future.
representative colors of the image ordered by importance (size of the cluster)
Extract representative colors from image data.
image data to extract the colors from
upper limit on the number of colors to be returned
representative colors of the image ordered by importance (size of the cluster)
Generated using TypeDoc
Fits a linear gradient to an image
because of it's dependency on
<canvas>
this function only works in the browser. In nodejs usefitGradientToImageData
directly instead.