2

Using the Kinect, I'm taking height measurements of both hands from a table, and displaying a color on the screen that's determined by the proportion of the heights. For example, if handProportion = .5, the screen would be green. At any other proportion, the screen is red. However, I need green to transition smoothly into red.

My first instinct is color bitshifting, but that sounds complicated. How can I write a function that displays a color from a gradient based on a position value in that gradient?

Thank you!

mikey555
  • 432
  • 3
  • 8
  • 19

1 Answers1

1

It seems like you need to interpolate between two colors given a ratio: Color Interpolation Between 3 Colors in .NET

Community
  • 1
  • 1
Kirill Osenkov
  • 8,786
  • 2
  • 33
  • 37