WPF Color interpolation

后端 未结 5 1200
离开以前
离开以前 2021-01-15 14:43

I am trying to paint a WPF control\'s background based on a palette where each color has been assigned with values (e.g. Red = 0, DarkGreen = 10, Green = 20,LightGreen =30)

5条回答
  •  梦毁少年i
    2021-01-15 14:55

    I think you'll be better of using a value converter, just take one of the interpolation functions suggested in the other answers and put in in a value converter, use this converter to bind the background property to the value and you're done.

提交回复
热议问题