public class HTColorSensor extends Sensor
Constructor and Description |
---|
HTColorSensor()
Creates a sensor instance connected to port S1.
|
HTColorSensor(SensorPort port)
Creates a sensor instance connected to the given port.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor()
Polls the sensor.
|
int |
getColorID()
Returns the color ID (0..17).
|
int |
getColorInt()
Polls the sensor.
|
static boolean |
inColorCube(java.awt.Color color,
int[] colorCube)
Checks if given color lies within given color cube.
|
public HTColorSensor(SensorPort port)
port
- the port where the sensor is plugged-inpublic HTColorSensor()
public java.awt.Color getColor()
public int getColorInt()
public int getColorID()
public static boolean inColorCube(java.awt.Color color, int[] colorCube)
color
- the color to checkcolorCube
- an integer array of 6 boundary values in the order:
red_min, red_max, green_min, green_max, blue_min, blue_max