On 13 September 2016 at 12:05, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > On 9/12/2016 2:08 PM, John Colvin wrote: >> >> On Monday, 12 September 2016 at 19:59:58 UTC, Edwin van Leeuwen wrote: >>> >>> On Monday, 12 September 2016 at 19:55:57 UTC, Guillaume Piolat wrote: >>>> >>>> - I've wanted a function like colorFromString many times. It's >>>> especially >>>> nice with the added #RGBA and #RRGGBBAA syntax that eg. SVG lacks. >>> >>> >>> What happens when the string is invalid? Does it throw an error? >> >> >> It should be integrated with std.conv.parse and std.conv.to and follow >> their >> conventions. > > > I'm not so sure. Follow the conventions, ok, but integrating them in - they > are already large and complex.
std.conv.to seems to 'just work' for color type conversion. I'd like to support string -> color conversion via std.conv.to; ie: auto c = "#FFFF00".to!RGB8; Is there a simple way to do that?