At 15:58 23/07/01 -0600, Roberto Peņa wrote:
by the way do you know a better way to get the hex values??
is there any function to make that??

Unless I've misunderstood you (which is always possible :-/):-

for (var i=0,color="#"; i<3; i++)
{
        var gun = (rgb[3 + i] + ptr * (rgb[0 + i] - rgb[3 + i])/steps) | 0;
        if (gun < 16) color += "0";             // don't forget the leading zero!
        color += gun.toString(16);      // ("radix" parameter = 16) ==> "base 16"
}

"| 0" is the quicky trick I use to convert the (floating point) result to an integer.

But whether you think this is easier than what you're doing already is another question entirely. :-)

Cheers, .....Nick Pelling..... // Aardvark Software _______________________________________________ Dynapi-Help mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to