Class: Color

Color()

Class representing a Color TinkaTop

Constructor

new Color()

Creates an instance of the Color class
Source:

Extends

Methods

get_id() → {number}

Get the value of id. ID's are determined by the Tinkamo hardware protocol.
Overrides:
Source:
Returns:
Type
number

get_name() → {string}

Get the value of name
Overrides:
Source:
Returns:
Type
string

sense(command_id, command) → {boolean|Array.<number>}

Returns an array containing three integers refering to the red, green, and blue content of a surface captured by the sensor. The sensor may also send a value indicating that it stopped receiving color (e.g. when held too far from from a surface) which we interpret and return as false.
Parameters:
Name Type Description
command_id number
command Array.<number>
Overrides:
  • TinkaTop#sense
Source:
Returns:
array with three values [red, green, blue]
Type
boolean | Array.<number>