GODPAPER | All Packages | All Classes | Index | Frames No Frames |
Color

Package | starling.utils
Class | public class Color
Inheritance | Color Object

A utility class containing predefined colors and methods converting between different color representations.

Public Methods

| Method | Defined By
--- | --- | ---
|  | argb(alpha:int, red:int, green:int, blue:int):uint [static] Creates an ARGB color, stored in an unsigned integer. | Color
|  | getAlpha(color:uint):int [static] Returns the alpha part of an ARGB color (0 - 255). | Color
|  | getBlue(color:uint):int [static] Returns the blue part of an (A)RGB color (0 - 255). | Color
|  | getGreen(color:uint):int [static] Returns the green part of an (A)RGB color (0 - 255). | Color
|  | getRed(color:uint):int [static] Returns the red part of an (A)RGB color (0 - 255). | Color
|  | rgb(red:int, green:int, blue:int):uint [static] Creates an RGB color, stored in an unsigned integer. | Color

Public Constants

| Constant | Defined By
--- | --- | ---
|  | AQUA : uint = 0x00ffff [static] | Color
|  | BLACK : uint = 0x000000 [static] | Color
|  | BLUE : uint = 0x0000ff [static] | Color
|  | FUCHSIA : uint = 0xff00ff [static] | Color
|  | GRAY : uint = 0x808080 [static] | Color
|  | GREEN : uint = 0x008000 [static] | Color
|  | LIME : uint = 0x00ff00 [static] | Color
|  | MAROON : uint = 0x800000 [static] | Color
|  | NAVY : uint = 0x000080 [static] | Color
|  | OLIVE : uint = 0x808000 [static] | Color
|  | PURPLE : uint = 0x800080 [static] | Color
|  | RED : uint = 0xff0000 [static] | Color
|  | SILVER : uint = 0xc0c0c0 [static] | Color
|  | TEAL : uint = 0x008080 [static] | Color
|  | WHITE : uint = 0xffffff [static] | Color
|  | YELLOW : uint = 0xffff00 [static] | Color

Method Detail

argb | () | method

`public static function argb(alpha:int, red:int, green:int, blue:int):uint`

Creates an ARGB color, stored in an unsigned integer. Channels are expected in the range 0 - 255.

Parameters

| `alpha:int`
| `red:int`
| `green:int`
| `blue:int`

Returns

| `uint`

getAlpha | () | method |

`public static function getAlpha(color:uint):int`

Returns the alpha part of an ARGB color (0 - 255).

Parameters

| `color:uint`

Returns

| `int`

getBlue | () | method |

`public static function getBlue(color:uint):int`

Returns the blue part of an (A)RGB color (0 - 255).

Parameters

| `color:uint`

Returns

| `int`

getGreen | () | method |

`public static function getGreen(color:uint):int`

Returns the green part of an (A)RGB color (0 - 255).

Parameters

| `color:uint`

Returns

| `int`

getRed | () | method |

`public static function getRed(color:uint):int`

Returns the red part of an (A)RGB color (0 - 255).

Parameters

| `color:uint`

Returns

| `int`

rgb | () | method |

`public static function rgb(red:int, green:int, blue:int):uint`

Creates an RGB color, stored in an unsigned integer. Channels are expected in the range 0 - 255.

Parameters

| `red:int`
| `green:int`
| `blue:int`

Returns

| `uint`

Constant Detail

AQUA | Constant

`public static const AQUA:uint = 0x00ffff`

BLACK | Constant |

`public static const BLACK:uint = 0x000000`

BLUE | Constant |

`public static const BLUE:uint = 0x0000ff`

FUCHSIA | Constant |

`public static const FUCHSIA:uint = 0xff00ff`

GRAY | Constant |

`public static const GRAY:uint = 0x808080`

GREEN | Constant |

`public static const GREEN:uint = 0x008000`

LIME | Constant |

`public static const LIME:uint = 0x00ff00`

MAROON | Constant |

`public static const MAROON:uint = 0x800000`

NAVY | Constant |

`public static const NAVY:uint = 0x000080`

OLIVE | Constant |

`public static const OLIVE:uint = 0x808000`

PURPLE | Constant |

`public static const PURPLE:uint = 0x800080`

RED | Constant |

`public static const RED:uint = 0xff0000`

SILVER | Constant |

`public static const SILVER:uint = 0xc0c0c0`

TEAL | Constant |

`public static const TEAL:uint = 0x008080`

WHITE | Constant |

`public static const WHITE:uint = 0xffffff`

YELLOW | Constant |

`public static const YELLOW:uint = 0xffff00`

Thu Jan 16 2014, 01:11 PM +08:00