I didn't know if this fell under share code or questions, as this isn't a question about Python or Pythonista per se.
I know this is a simple equation. I remember doing something like this in highschool. For the life of me I can't think of the solution or how to search for the solution. Essentially I am changing the .background_color of a tableview via scrollview_did_scroll. I want to move from 1.0 to a target value as the scrollview.content_offset[1] increases, when the offset hits 70 I will change to another action. The target value being the respective values in myrgb.
This is a snippet of example code. I know we hate snippets, but the entire project looks rather gross as its still a scratchpad draft.
def scrollview_did_scroll(self, scrollview):
x, y = scrollview.content_offset
myrgb = (26.0/256, 188.0/256, 156.0/256)
r =
g =
b =
#At y's origin, r, g, b will be (1.0, 1.0, 1.0)
scrollview.background_color = (r, g, b)