package com.exanimo.utils { /** * * ColorUtil.as * * @author matthew at exanimo dot com * @author Ryan Sprake * @version 2007.11.05 * */ public class ColorUtil { /** * * */ public function ColorUtil() { throw new Error('ColorUtil contains static utility methods and cannot be instantialized.'); } /** * * Parses a String for a hexadecimal color. * * @param str:String * the String to parse * @returns uint * a hexadecimal representation of the color * */ public static function parseColor(str:String):uint { if (str.substr(0, 2) == '0x') { str = str.substr(2); } else if (str.substr(0, 1) == '#') { str = str.substr(1); } return parseInt(str, 16); } } }