Rev | Line | |
---|
[7849] | 1 | /**
|
---|
| 2 | * ...
|
---|
| 3 | * @author Default
|
---|
| 4 | * @version 0.1
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | package string {
|
---|
| 8 |
|
---|
| 9 | public class Utils {
|
---|
| 10 |
|
---|
| 11 | public function Utils() {
|
---|
| 12 |
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | static public function get_colour( col:String ) : Number
|
---|
| 16 | {
|
---|
| 17 | if( col.substr(0,2) == '0x' )
|
---|
| 18 | return Number(col);
|
---|
| 19 |
|
---|
| 20 | if( col.substr(0,1) == '#' )
|
---|
| 21 | return Number( '0x'+col.substr(1,col.length) );
|
---|
| 22 |
|
---|
| 23 | if( col.length==6 )
|
---|
| 24 | return Number( '0x'+col );
|
---|
| 25 |
|
---|
| 26 | // not recognised as a valid colour, so?
|
---|
| 27 | return Number( col );
|
---|
| 28 |
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.