(color)
| 18 | * @return {Phaser.Types.Display.ColorObject} An object with the alpha, red, green, and blue values set in the a, r, g, and b properties. |
| 19 | */ |
| 20 | var IntegerToRGB = function (color) |
| 21 | { |
| 22 | if (color > 16777215) |
| 23 | { |
| 24 | // The color value has an alpha component |
| 25 | return { |
| 26 | a: color >>> 24, |
| 27 | r: color >> 16 & 0xFF, |
| 28 | g: color >> 8 & 0xFF, |
| 29 | b: color & 0xFF |
| 30 | }; |
| 31 | } |
| 32 | else |
| 33 | { |
| 34 | return { |
| 35 | a: 255, |
| 36 | r: color >> 16 & 0xFF, |
| 37 | g: color >> 8 & 0xFF, |
| 38 | b: color & 0xFF |
| 39 | }; |
| 40 | } |
| 41 | }; |
| 42 | |
| 43 | module.exports = IntegerToRGB; |
no outgoing calls
no test coverage detected
searching dependent graphs…