Subject duflp rgbtohex()
From Wayne <nospam@nospam.com>
Date Sun, 17 Dec 2017 13:52:51 -0500
Newsgroups dbase.getting-started

I started using rgbtohex() in convert.cc in duflp.  Tho it has been around for awhile, the code seems very wrong.

Feed 0,94,138 (red,green,blue) values into it, and it returns hex 8A5E00.  It should return 005E8A.  

The error is that it is flipping rgb values.  The code gets the hex for red (cRed) then for green (cGreen) then blue (cBlue).  BUT it adds these 3 strings incorrectly cBlue+cGreen+cRed.  It should be cRed+cGreen+cBlue to get the final hex value.

Trouble is, this code has been used so long I keep thinking I missed something.  

Anyone else finding trouble with rgbtohex?

Thanks,
Wayne