cinder/Cinder — pull request #374 by nselikoff (2013-09-07 18:27:18+00:00)
Title: Support instantiating Color(A) with a string that represents a hex value

Based on the discussion that started on [this forum thread](http://forum.libcinder.org/topic/new-color-by-name) about supporting instantiation of Color(A) based on a hex value that is a string, not a true hex value (e.g. it came from an SVG file, JSON stream, or some other source). This is just a convenience in order to not have to deal with the stringstream conversion when you're in a scenario like this.

In the forum there was some discussion about alpha values and avoiding ambiguity. I've just used the same syntax and ordering that the existing hex/hexA methods use as seen below.

**Open Questions:**

1. RGB hex colors as strings of the form #FF0000 (leading hash): Should we support that? There's no equivalent for alpha (CSS, SVG and other such things will either use rgba() or a separate opacity attribute as far as I know).
2. Error checking: I'm not sure the right way to go about this. What should happen if someone uses a mal-formed string in the constructor?

```c++
// set the color to red via a true hexadecimal number (existing)
gl::color( Color::hex( 0xFF0000 ) );

// set the color to green via a string hexadecimal number (new)
gl::color( Color::hex( "0x00FF00" ) );

// set the color to 50% red via a true hexadecimal number (existing)
gl::color( ColorA::hexA( 0x80FF0000 ) );

// set the color to 50% green via a string hexadecimal number (new)
gl::color( ColorA::hexA( "0x8000FF00" ) );
```