RGBColor const X11RGBfromhex(string const & hexname) { RGBColor col; istringstream is(STRCONV(hexname)); char c;
is >> c >> std::setbase(16) >> setfill('0') >> setw(2) >> col.r >> setw(2) >> col.g >> setw(2) >> col.b; lyxerr << "string=" << hexname << endl; lyxerr << "c=" << c << endl; lyxerr << "col.r=" << col.r << endl; lyxerr << "col.g=" << col.b << endl; lyxerr << "col.b=" << col.g << endl; return col; } For hexname = "#ff6a88" the first two digits should go to col.r, the next two to col.g and the last two to col.b. Instead they all six go to col.r. What did I miss? The character c is read correctly. I have included iomanip. Martin
pgp00000.pgp
Description: PGP signature