-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathcolor-mapper-api.d.ts
29 lines (25 loc) · 995 Bytes
/
color-mapper-api.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** ColorMapperJSProxy */
declare class ColorMapper {
/**
* Constructs a ColorMapper object which maps RGB colors to device specific color codes
*
* @param availableColors List of number pairs (e.g. {0xFF0000: 1, 0x00FF00: 2} )
*/
constructor (availableColors: { [rgbColor: number]: number });
/**
* For a given RGB color code (e.g. 0xFF0000), this finds the nearest
* available color and returns a JS object with properties "red", "green",
* "blue" (each with value range 0-255).
*
* @param colorCode Device specific color code
*/
getNearestColor(colorCode: number): {[rgb: number]: number};
/**
* For a given RGB color code (e.g. 0xFF0000), this finds the nearest
* available color, then returns the value associated with that color
* (which could be a MIDI byte value for example).
*
* @param rgbColor RGB color (e.g. 0xFF00CC)
*/
getValueForNearestColor(rgbColor: number): number;
}