source: trunk/fl5/src/com/longtailvideo/jwplayer/model/Color.as @ 1033

Revision 1033, 738 bytes checked in by pablo, 3 years ago (diff)
  • Fixes an issue where color settings could incorrectly return 0
  • Fixes swf skin colorization issue in playlist
Line 
1package 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                        var colorString:String = ((_color == 0) ? "000000" : _color.toString(16));
19                        while (colorString.length < 6) {
20                                colorString = "0" + colorString;
21                        }
22                        return "0x" + colorString;
23                }
24               
25                public function get color():uint {
26                        return _color;
27                }
28        }
29}
Note: See TracBrowser for help on using the repository browser.