# Gradient Fills in WinXP - Revisited

MisterX b.xavier at internet.lu
Sat Sep 24 01:34:18 CDT 2005

```Nice and simple! great example!...

put binaryEncode("CCCC",0,tR,tG,tB) after tImageData

whatever that means ;)

I compared it to GradientsNO2 and they are the same gradients! Cool!

Thanks to Chipp, a new revision of GradientsNO2 is coming with a few fixes
and more features like logarithmic or custom f(x) gradients and multi-band
color gradients... Alas between color perception and logarithmic perception,
there's a world of difference!

How many different gradients can there be I wondered... hmmm...

I found a very nice site for this:
http://www.2dcurves.com

Wikipedia has also a lot on "distributions" which is what this is all
about... Linear stuff being so boring, I spent 4 hours on this and heres the
results...

I fiddled quite a bit with different logarithms until I came up with the
logarithmic interpolation gradient which is really smooth and cool - alas
it's not easy to control the direction sometimes (in the following example,
the gradient's direction can be twisted in a number of ways...

I'll let you plug in the different statements that are commented... Each has
it's nice effects... The combinations however are endless and I almost gave
up...

-- put ln(tCurrentRow)*ln(pHeight)+1   into tRatio -- optional cool
-- note the +1 was added to avoid div/0 if you switch the operator
(tXdelta * tRatio) to .../rRatio
-- put ln(tCurrentRow)/(1-ln(pHeight)) into tRatio -- better but not
correct for all colors

put ln(tCurrentRow)/ln(pHeight) into tRatio -- 1 band log-gradient
finally
--put 1-ln(tCurrentRow)/ln(pHeight) into tRatio -- reverse effect
--put ln(tCurrentRow)*ln(pHeight) into tRatio -- multiband effect
put round(abs(tR1 - (tRdelta * tRatio))) into tR
put round(abs(tG1 - (tGdelta * tRatio))) into tG
put round(abs(tB1 - (tBdelta * tRatio))) into tB

if you use the commented tRatio function and swap the operator of "any" of
the t*delta * tRatio in the last 3 lines above you will find some totally
cool gradients that just cannot be described! Very cool!!!

other fun functions can be done with

get ln(tCurrentRow)*ln(pHeight) -- or any operator instead of the "*"

These came from GradientsNO2's new revision (not published yet) and they
need some adapting to Chipp's functions but it should give you some hours of
pleasure playing with gradients... Note that there's not value checking in
these last examples so you may hit div/0 or 1,inf...

one last example, to make candy bars:
set the colors to pink and yellow
use the statement put ln(tCurrentRow)*ln(pHeight) into tRatio

Since the interest in SpellNO2 has been dismal, I think I will spend some
time on MoireX with logarithmic polynomial transcendental fractals and
gradients ;) This has been a fun morning, thanks to Chipp!

enjoy
Xavier

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Chipp Walters
Sent: Saturday, September 24, 2005 12:39 AM
To: subzero569 at gmail.com; How to use Revolution
Subject: Re: Gradient Fills in WinXP - Revisited

Joshua,

Sorry to take so long getting back to you. I've been away in New Mexico, and
now getting ready for a hurricane ;-)

The gradient demo script you requested is available by entering into the msg
box:

or at the bottom of the webpage:

best,

Chipp

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com