[Tkinter-discuss] Calculating a ripening tomato

Bob Greschke bob at passcal.nmt.edu
Tue Oct 18 01:05:07 CEST 2011


Do you think there is a formula (probably three of them) for calculating the RGB colors for the background color of a widget of a tomato ripening from green to red with, let's say, an input of 0-100%?  It's not just Red 0-255 and green 255-0, because the brown shows up in the middle and doesn't look good at all.  There must be some blue in there somewhere, but I'd like to calculate the values, instead of just looking them up in a list of 100 RGB values.  I'd think there would be something like this for various things somewhere.  Autumn leaves turning colors, sunsets...  I've done widget coloring for things like different elevations and water depths, but for those I just binned the values into 16 or thereabouts bins and looked up the color I wanted to use.  Calculating the values would be more elegant, right? :)

I searched around a little, but just kept getting schooled on how to grow tomatoes.

Bob



More information about the Tkinter-discuss mailing list