changeset 99 | 9d968fbcaa2a |
child 105 | 25ac8802c189 |
92:a323578ea954 | 99:9d968fbcaa2a |
---|---|
1 /** |
|
2 * js/utils.js |
|
3 * |
|
4 * basic tools |
|
5 * |
|
6 */ |
|
7 |
|
8 'use strict'; |
|
9 |
|
10 function rgb2hex (r, g, b) { |
|
11 return "0x" |
|
12 + ("0" + parseInt(r, 10).toString(16)).slice(-2) |
|
13 + ("0" + parseInt(g, 10).toString(16)).slice(-2) |
|
14 + ("0" + parseInt(b, 10).toString(16)).slice(-2); |
|
15 }; |
|
16 |
|
17 module.exports = rgb2hex; |