Package lejos.robotics
Class ColorAdapter
- java.lang.Object
-
- lejos.robotics.ColorAdapter
-
- All Implemented Interfaces:
ColorDetector,ColorIdentifier
public class ColorAdapter extends java.lang.Object implements ColorDetector, ColorIdentifier
-
-
Constructor Summary
Constructors Constructor Description ColorAdapter(BaseSensor colorSensor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetColor()Return the Red, Green and Blue values together in one object.intgetColorID()Return an enumerated constant that indicates the color detected.
-
-
-
Constructor Detail
-
ColorAdapter
public ColorAdapter(BaseSensor colorSensor)
-
-
Method Detail
-
getColorID
public int getColorID()
Description copied from interface:ColorIdentifierReturn an enumerated constant that indicates the color detected. e.g. Color.BLUE- Specified by:
getColorIDin interfaceColorIdentifier- Returns:
- An integer from the Color constants, such as Color.BLUE
-
getColor
public Color getColor()
Description copied from interface:ColorDetectorReturn the Red, Green and Blue values together in one object.- Specified by:
getColorin interfaceColorDetector- Returns:
- Color object containing the three RGB component values between 0-255.
-
-