> This code is incorrect, you should divide by 257, not 256. See the > GDK_COLOR_RGB macro.
That's not true. GDK_COLOR_RGB multiplies by 257 (= 0x10001) to distribute the bits evenly ( http://www.mindcontrol.org/~hplus/graphics/expand-bits.html ). To get back, you can just shift (or, formulated differently, i == (i*257)/256 for all i < 256). --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---