A class with a static method that parses a good amount of the current W3C methods for representing colors, including: #RGB; #RRGGBB; rgb(r, g, b); rgb(r%, g%, b%); and the SVG color names (the list is here).
The file is a .txt (since .as aren’t allowed). Just rename the extension and the class will be ready for use.