(input, color)
| 23 | * @return {Phaser.Display.Color} A Color object containing the converted color value. |
| 24 | */ |
| 25 | var ValueToColor = function (input, color) |
| 26 | { |
| 27 | var t = typeof input; |
| 28 | |
| 29 | switch (t) |
| 30 | { |
| 31 | case 'string': |
| 32 | |
| 33 | if (input.substr(0, 3).toLowerCase() === 'rgb') |
| 34 | { |
| 35 | return RGBStringToColor(input, color); |
| 36 | } |
| 37 | else |
| 38 | { |
| 39 | return HexStringToColor(input, color); |
| 40 | } |
| 41 | |
| 42 | case 'number': |
| 43 | |
| 44 | return IntegerToColor(input, color); |
| 45 | |
| 46 | case 'object': |
| 47 | |
| 48 | return ObjectToColor(input, color); |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | module.exports = ValueToColor; |
no test coverage detected
searching dependent graphs…