Shouldn't it be:

if (actual/total < 0.5) {
red = 255;
green = (actual/total)*2*255;
}
else {
green = 255;
red = ((1-(actual/total))*2*255);
}


----- Original Message ----- 
From: "Lz" <[EMAIL PROTECTED]>
To: <amsn-devel@lists.sourceforge.net>
Sent: Wednesday, December 28, 2005 9:17 AM
Subject: Re: [Amsn-devel] About a Feature Request (progressbar on file
transfers)


better explained:

if (actual/total < 0.5) {
red = 255;
green = (actual/total)*255;
}
else {
green = 255;
red = ((1-(actual/total))*255);
}

If we're at the first half:
red = 255, green gets from 0 to 255.
If we're at the last half:
green = 255, red gets from 255 to 0.


On 12/27/05, Lz <[EMAIL PROTECTED]> wrote:
> Definitely:
>
> if (actual/total < 0.5) {
> red = 255;
> green = actual/total*255;
> }
> else {
> green = 255;
> red = ((1-(actual/total))*255);
> }
>
>
> On 12/27/05, Youness Alaoui <[EMAIL PROTECTED]> wrote:
> > ok, I though half/half RG would make it yellow, but yellow is full/full
RG
> > .. well then, what about that ?
> > if (total/actual < 50 ) {
> > red = 255;
> > green = total/actual/50 * 255
> > } else {
> > green = 255;
> > red = 255 - (((total/actual) -50)/50) * 255);
> > }
> >
> > On Tue, 27 Dec 2005 16:48:47 -0500, Lz <[EMAIL PROTECTED]> wrote:
> >
> > > hmmm the way i said did a red/yellow/green...
> > > the way you said just does red/green :P
> > > (i just reproduced what that guy asked, and i think the best thing
> > > should be test both...
> > > anyway the red/green doesn't looks very cool, i think (i made
> > > something alike some years ago))...
> > >
> > > On 12/27/05, Youness Alaoui <[EMAIL PROTECTED]> wrote:
> > >> red = total/actual/100 * 255
> > >> green = 255 - red
> > >>
> > >> KKRT
> > >>
> > >> On Tue, 27 Dec 2005 06:30:55 -0500, Lz <[EMAIL PROTECTED]> wrote:
> > >>
> > >> > if you can freely draw on that bar, you can do that, yes :)
> > >> >
> > >> > On 12/27/05, Harry Vennik <[EMAIL PROTECTED]> wrote:
> > >> >> Maybe even better:
> > >> >> Only add the new color at the end of the bar, so, once at 100%,
the
> > >> bar
> > >> >> wil
> > >> >> have a color gradient ranging from red on the left to green on the
> > >> >> right.
> > >> >>
> > >> >> This could be a skin option with the following choices:
> > >> >> solid $color                    (always the same color)
> > >> >> fading $color1 $color2  (color fading from color1 to color2 as Lz
> > >> >> suggested)
> > >> >> gradient $color1 $color2        (color gradient from color1 to
> > >> color2)
> > >> >>
> > >> >>
> > >> >> Op dinsdag 27 december 2005 11:54, schreef Lz:
> > >> >> > Hello,
> > >> >> >
> > >> >> > I found this feature request:
> > >> >> >
> > >> >>
> > >>
http://sourceforge.net/tracker/index.php?func=detail&aid=1087771&group_id=5
> > >> >> >4091&atid=472658
> > >> >> >
> > >> >> > He would want the progressbar of the file transfers switch from
> > >> red to
> > >> >> > yellow when the transfer is at 50% and from yellow to green when
> > >> the
> > >> >> > transfer is at 100%.
> > >> >> >
> > >> >> > There's a way of doing it more soft, it would be drawing the bar
at
> > >> >> > each moment with this colours (red,green,blue) where total is
the
> > >> >> > total size of the file and actual is the actual sent/received
size:
> > >> >> >
> > >> >> > if (total/actual < 50) red = 1;
> > >> >> > else red = (total/2)/actual
> > >> >> > if (total/actual < 50) green = 0;
> > >> >> > else green = (actual/(total/2))-1
> > >> >> > //blue is always 0!!
> > >> >> >
> > >> >> > (You get red and green between 0 and 1, if you want them between
0
> > >> and
> > >> >> > 255 just multiply for 255.
> > >> >> >
> > >> >> > if (total/actual < 50) red = 255;
> > >> >> > else red = (total*128)/actual
> > >> >> > if (total/actual < 50) green = 0;
> > >> >> > else green = (actual*510/(total))-255
> > >> >> > //blue is always 0!!
> > >> >> >
> > >> >> > --
> > >> >> > Lz ([EMAIL PROTECTED]).
> > >> >> > http://elezeta.bounceme.net
> > >> >> >
> > >> >> >
> > >> >> > -------------------------------------------------------
> > >> >> > This SF.net email is sponsored by: Splunk Inc. Do you grep
through
> > >> log
> > >> >> > files for problems?  Stop!  Download the new AJAX search engine
> > >> that
> > >> >> makes
> > >> >> > searching your log files as easy as surfing the  web.  DOWNLOAD
> > >> >> SPLUNK!
> > >> >> > http://ads.osdn.com/?ad_idv37&alloc_id865&op=Click
> > >> >> > _______________________________________________
> > >> >> > Amsn-devel mailing list
> > >> >> > Amsn-devel@lists.sourceforge.net
> > >> >> > https://lists.sourceforge.net/lists/listinfo/amsn-devel
> > >> >>
> > >> >>
> > >> >> -------------------------------------------------------
> > >> >> This SF.net email is sponsored by: Splunk Inc. Do you grep through
> > >> log
> > >> >> files
> > >> >> for problems?  Stop!  Download the new AJAX search engine that
makes
> > >> >> searching your log files as easy as surfing the  web.  DOWNLOAD
> > >> SPLUNK!
> > >> >> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > >> >> _______________________________________________
> > >> >> Amsn-devel mailing list
> > >> >> Amsn-devel@lists.sourceforge.net
> > >> >> https://lists.sourceforge.net/lists/listinfo/amsn-devel
> > >> >>
> > >> >
> > >> >
> > >> > --
> > >> > Lz ([EMAIL PROTECTED]).
> > >> > http://elezeta.bounceme.net
> > >> >
> > >> >
> > >> > -------------------------------------------------------
> > >> > This SF.net email is sponsored by: Splunk Inc. Do you grep through
log
> > >> > files
> > >> > for problems?  Stop!  Download the new AJAX search engine that
makes
> > >> > searching your log files as easy as surfing the  web.  DOWNLOAD
> > >> SPLUNK!
> > >> > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
> > >> > _______________________________________________
> > >> > Amsn-devel mailing list
> > >> > Amsn-devel@lists.sourceforge.net
> > >> > https://lists.sourceforge.net/lists/listinfo/amsn-devel
> > >>
> > >>
> > >>
> > >> --
> > >> KaKaRoTo
> > >>
> > >>
> > >> -------------------------------------------------------
> > >> This SF.net email is sponsored by: Splunk Inc. Do you grep through
log
> > >> files
> > >> for problems?  Stop!  Download the new AJAX search engine that makes
> > >> searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
> > >> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > >> _______________________________________________
> > >> Amsn-devel mailing list
> > >> Amsn-devel@lists.sourceforge.net
> > >> https://lists.sourceforge.net/lists/listinfo/amsn-devel
> > >>
> > >
> > >
> > > --
> > > Lz ([EMAIL PROTECTED]).
> > > http://elezeta.bounceme.net
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > > files
> > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
> > > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
> > > _______________________________________________
> > > Amsn-devel mailing list
> > > Amsn-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/amsn-devel
> >
> >
> >
> > --
> > KaKaRoTo
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
> > for problems?  Stop!  Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > _______________________________________________
> > Amsn-devel mailing list
> > Amsn-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/amsn-devel
> >
>
>
> --
> Lz ([EMAIL PROTECTED]).
> http://elezeta.bounceme.net
>


--
Lz ([EMAIL PROTECTED]).
http://elezeta.bounceme.net


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=ick
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to