[dev] Fix: Colorpicker javascript error
Marko Djukic
marko at oblo.com
Wed Aug 13 19:49:24 PDT 2003
hi,
not having an IE to check where it was failing, do you mind talking me through
the couple of changes?
thanks,
marko
Quoting Cariad Ilmàra <cariad at adnx.net>:
> Hello,
>
> Here's a fix I made for the colorpicker (horde/util/colorpicker.php) to
> avoid javascript errors (colours with negative values) with IE.
>
> Triple checked it; and it seems as precise as the old one to me...
>
> Sorry for the other email... I screwed up between the lists... :(
>
> =====================
>
> --- colorpicker.php 2003-08-11 23:09:23.000000000 +0200
> +++ colorpicker.php 2003-08-11 23:09:14.000000000 +0200
> @@ -87,20 +87,19 @@
> y = y - 160;
> rmax = 255;
> gmax = 0;
> - bmax = 255 - (y / 32.0) * 255;
> + bmax = 255 - (y / 32.0) * 160;
> }
>
> if (x <= 50) {
> var r = Math.floor(rmax * x / 50.0);
> var g = Math.floor(gmax * x / 50.0);
> var b = Math.floor(bmax * x / 50.0);
> -
> return makeColor(r,g,b);
> } else {
> x = x - 50;
> - var r = Math.floor(rmax + (x / 50.0) * (255 - rmax));
> - var g = Math.floor(gmax + (x / 50.0) * (255 - gmax));
> - var b = Math.floor(bmax + (x / 50.0) * (255 - bmax));
> + var r = Math.floor(rmax + (x / 50.0) * (250 - rmax));
> + var g = Math.floor(gmax + (x / 50.0) * (250 - gmax));
> + var b = Math.floor(bmax + (x / 50.0) * (250 - bmax));
> return makeColor(r,g,b);
> }
> }
>
> --
> Cariad Ilmàra
> http://cariad.adnx.net/
> "Unix was made to please the programmers,
> Mac was made to please the users,
> Windows was made to please the accountants."
>
>
>
> --
> Horde mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>
>
>
> --
> Cariad Ilmàra
> http://cariad.adnx.net/
> "Unix was made to please the programmers,
> Mac was made to please the users,
> Windows was made to please the accountants."
>
>
>
> --
> Horde developers mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>
More information about the dev
mailing list