ColorDriver
Extends:
src/drivers/motion/MotionDriverSimulator.js~EventEmitter → ColorDriver
Driver detects color based on RGB components
Method Summary
Public Methods | ||
public |
Get last read color |
|
public |
Converts an RGB color value to HSL. |
|
public |
Converts an RGB color value to HSV. |
|
public |
Start reading data from sensor |
|
public |
stop() Stop receiving RGB components |
Public Methods
public rgbToHsl(r: Number, g: Number, b: Number): * source
Converts an RGB color value to HSL. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space. Assumes r, g, and b are contained in the set [0, 255] and returns h, s, and l in the set [0, 1].
Return:
* | Array The HSL representation |
public rgbToHsv(r: Number, g: Number, b: Number): * source
Converts an RGB color value to HSV. Conversion formula adapted from http://en.wikipedia.org/wiki/HSV_color_space. Assumes r, g, and b are contained in the set [0, 255] and returns h, s, and v in the set [0, 1].
Return:
* | Array The HSV representation |