Search Results

Search found 3 results on 1 pages for 'navand'.

Page 1/1 | 1 

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

    - by navand
    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!

    Read the article

  • What's the most effective way to interpolate between two colors? (pseudocode and bitwise ops expecte

    - by navand
    Making a Blackberry app, want a Gradient class. What's the most effective way (as in, speed and battery life) to interpolate two colors? Please be specific. // Java, of course int c1 = 0xFFAA0055 // color 1, ARGB int c2 = 0xFF00CCFF // color 2, ARGB float st = 0 // the current step in the interpolation, between 0 and 1 /* Help from here on. Should I separate each channel of each color, convert them to decimal and interpolate? Is there a simpler way? interpolatedChannel = red1+((red2-red1)*st) interpolatedChannel = interpolatedChannel.toString(16) ^ Is this the right thing to do? If speed and effectiveness is important in a mobile app, should I use bitwise operations? Help me! */

    Read the article

1