Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transitioning Colours

 
Mikpo Siru
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written a class that transitions from a starting colour to and ending colour. However there is one problem: the ending colour is always slightly off from what I specify. I've done my best to take care of rounding errors...any hints as to how I should proceed?

Thanks.

 
Mikpo Siru
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just thought of a crude way around it: when colour transition loop finishes, force the final colour to be the given ending colour. However the discontinuity in colour is obvious. Other suggestions are welcome!
 
Mikpo Siru
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed it by performing the step calculations in the loop.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic