Numeric range conversion?
in
Programming Questions
•
1 years ago
Is there a way to convert a range of values to another range?
For instance I have a node-garden type program with a bunch of nodes floating around and when they get within 100px of one another they draw a line between them. I would like this line to start at 0 alpha and end at a maximum of 255 (were the objects to meet), within the range of 100-0.
To clarify- when the tested object is 100px away, the line should have an alpha of 0. As it gets closer, the alpha increases accordingly.
1