| Revision 504,
615 bytes
checked in by pablo, 4 years ago
(diff) |
|
Need to check in required classes...
|
| Line | |
|---|
| 1 | package com.longtailvideo.jwplayer.model { |
|---|
| 2 | import com.longtailvideo.jwplayer.utils.TypeChecker; |
|---|
| 3 | |
|---|
| 4 | public class Color { |
|---|
| 5 | private var _color:uint; |
|---|
| 6 | |
|---|
| 7 | public function Color(color:*) { |
|---|
| 8 | if (color is String) { |
|---|
| 9 | _color = TypeChecker.stringToColor(color); |
|---|
| 10 | } else if (color is uint || color is Number) { |
|---|
| 11 | _color = color; |
|---|
| 12 | } else { |
|---|
| 13 | throw(new Error("Color must be a String, Number or uint")); |
|---|
| 14 | } |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | public function toString():String { |
|---|
| 18 | return "0x" + ((_color == 0) ? "000000" : _color.toString(16)); |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | public function get color():uint { |
|---|
| 22 | return _color; |
|---|
| 23 | } |
|---|
| 24 | } |
|---|
| 25 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.