public class ColorSensor extends Sensor
| Modifier and Type | Field and Description | 
|---|---|
| static int[][] | colorCubesColor cubes for detecting color labels.
 6 user adaptable int arrays with red_min, red_max, green_min, green_max, blue_min, blue_max
 for the colors Black, Blue, Green, Yellow, Red, White. | 
| Constructor and Description | 
|---|
| ColorSensor()Creates a sensor instance connected to port S1. | 
| ColorSensor(SensorPort port)Creates a sensor instance connected to the given port. | 
| Modifier and Type | Method and Description | 
|---|---|
| java.awt.Color | getColor()Returns a java.awt.Color reference to the color reading. | 
| int | getColorID()Returns a integer number ID for the current color reading. | 
| int | getColorInt()Returns the color as integer value of the color reading. | 
| ColorLabel | getColorLabel()Returns one of the enums of ColorLabel. | 
| lejos.hardware.sensor.EV3ColorSensor | getLejosSensor()Returns the reference of the the underlying 
 lejos.hardware.sensor.EV3ColorSensor. | 
| static boolean | inColorCube(java.awt.Color color,
           int[] colorCube)Checks if given color lies within given color cube. | 
| void | setFloodlight(int colorValue)Turns the red, green or blue LED on or all off. | 
getLejosPortpublic static int[][] colorCubes
 ColorSensor.colorCubes[1] = new int[]{0, 2, 0, 2, 0, 2};
public ColorSensor(SensorPort port)
port - the port where the sensor is plugged-inpublic ColorSensor()
public lejos.hardware.sensor.EV3ColorSensor getLejosSensor()
public java.awt.Color getColor()
public int getColorInt()
public int getColorID()
public ColorLabel getColorLabel()
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_maxpublic void setFloodlight(int colorValue)
colorValue - 0: red, 1: green, 2: blue, -1: all off