Advertisement
Guest User

Untitled

a guest
May 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. private Color getPointColor(int i, int j, float min, float max) {
  2.  
  3.         int value = Math.round((currentValues[i][j] - min) / (max - min) * 255);
  4.  
  5.         int blue = value;
  6.         int red = 255 - blue;
  7.  
  8.         if (blue > 255) blue = 255;
  9.         if (blue < 0) blue = 0;
  10.  
  11.         if (red > 255) red = 255;
  12.         if (red < 0) red = 0;
  13.  
  14.         return new Color(red, 0, blue);
  15.  
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement