Can I interpolate two HEX color values without converting them to RGB?

Posted by navand on Stack Overflow See other posts from Stack Overflow or by navand
Published on 2010-04-12T17:52:12Z Indexed on 2010/04/12 17:52 UTC
Read the original article Hit count: 268

Filed under:
|
|
|

I'm trying to make a Gradient Class for a Blackberry app. At first I thought about converting the HEX values to RGB and then interpolating them before converting the result back into HEX, but since I will be doing this for every pixel line of an area, and the calculations will be made by a mobile, I thought that maybe there's a more efficient way of doing it. Maybe involving those pesky bitwise operators which I know nothing of... or something.

So, is there a way of interpolating without converting to RGB and back? If so, is it faster than the original way? In any case, can you help me make the most efficient color interpolation?

Thank you in advance!

© Stack Overflow or respective owner

Related posts about hex

Related posts about hexadecimal