source: code/Website/open-flash-chart/string/Utils.as@ 7849

Last change on this file since 7849 was 7849, checked in by dennisw, 15 years ago
File size: 523 bytes
Line 
1/**
2* ...
3* @author Default
4* @version 0.1
5*/
6
7package 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.