Gradiant coloring

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe

    #1

    Gradiant coloring

    Hey all!

    I need to color from blue to red in sort of a gradient depending on a value.

    For example: lets say 1 is blue and red is 100. I need to change from blue
    to red depending on the value so 50 would be a color in between blue and red
    and 25 would be more blue than red.

    Does anyone have an algorithm to do this?

    Thanks.
    Joe


  • rowe_newsgroups

    #2
    Re: Gradiant coloring

    On Aug 30, 11:06 am, "Joe" <jbassk...@noem ail.noemailwrot e:
    Hey all!
    >
    I need to color from blue to red in sort of a gradient depending on a value.
    >
    For example: lets say 1 is blue and red is 100. I need to change from blue
    to red depending on the value so 50 would be a color in between blue and red
    and 25 would be more blue than red.
    >
    Does anyone have an algorithm to do this?
    >
    Thanks.
    Joe
    Can't you just use the GradientBrush in the System.Drawing namespace?

    Thanks,

    Seth Rowe

    Comment

    • Joe

      #3
      Re: Gradiant coloring

      Never mind. This is very simple. I just change the B & R.

      "Joe" <jbassking@noem ail.noemailwrot e in message
      news:%234Cqjhx6 HHA.5136@TK2MSF TNGP02.phx.gbl. ..
      Hey all!
      >
      I need to color from blue to red in sort of a gradient depending on a
      value.
      >
      For example: lets say 1 is blue and red is 100. I need to change from blue
      to red depending on the value so 50 would be a color in between blue and
      red and 25 would be more blue than red.
      >
      Does anyone have an algorithm to do this?
      >
      Thanks.
      Joe
      >

      Comment

      Working...