public class ColorSampler
extends java.lang.Object
Constructor and Description |
---|
ColorSampler(PApplet parent,
PImage img) |
ColorSampler(PApplet parent,
java.lang.String file) |
Modifier and Type | Method and Description |
---|---|
int |
getColorAt(float index)
Uses a float from 0 to 1.0 to get a color at the index mapped across the width of an image
|
java.util.ArrayList |
getColors(int amount)
Gets a defined number of colors mapped across an image
|
float |
map(float value,
float istart,
float istop,
float ostart,
float ostop) |
public ColorSampler(PApplet parent, java.lang.String file)
public ColorSampler(PApplet parent, PImage img)
public final float map(float value, float istart, float istop, float ostart, float ostop)
public int getColorAt(float index)
index
- a float from 0 to 1.0public java.util.ArrayList getColors(int amount)
amount
- amount of colors to get