Setting colors and thresholds in canvas component with draw.image


Recommended Posts

I am trying to draw an image with color thresholds in a canvas component using draw.image, but I can't seem to get the "colors" array passed in the correct format. What dimensions should the "colors" array be for passing RGB color codes? Thanks!

Link to comment
Share on other sites

It should be in the first dimension, so:

private colors
colors[0] = rgb(255,0,0)
colors[1] = rgb(0,255,0)
colors[2] = rgb(0,0,255)
private thresholds
thresholds[0] = 5
thresholds[1] = 12
thresholds[2] = 15

Draw.Image(..., colors, thresholds)

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.