calculate a colour gradient

Paul McGuire ptmcg at austin.rr._bogus_.com
Thu Jun 17 15:50:38 EDT 2004


"Mark Light" <light at soton.ac.uk> wrote in message
news:casc3t$r92$1 at aspen.sucs.soton.ac.uk...
> Hi,
>    I have a tk.scale bar for which I want the background to change from
> blue to red as I slide along it. The mechanics of this I can do, but
> the colour gradient I have is very crude - basically the amount of R in
> RGB just increases whilst the G and B are fixed values. Whilst this is
> not really a python question does anybody have any suggestions about
> calculating the RGB values for a smooth colour gradient?
>
>
> Mark.
>
>
>
>
What about:
scale R from 255 to 0
scale B from 0 to 255 (or compute as 255-R)
hold G constant (try values like 0, 64, and 128 to brighten or darken the
resulting reds and blues)

-- Paul





More information about the Python-list mailing list