That sounds a lot like Jasper Fforde's Shades of Grey, though they don't use the #ff0000 designations, at least in my US edition. Instead, especially in the earlier chapters, they talk about colors (sorry, colours) thusly:
"We're losing him," breathed Dad, handing back the 35-89-96. "Give me a 116-37-97."
and they'll describe someone as:
Yellow Beta male (Y: 54.9%, R: 22%), 26 yrs.