Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.                 // ensure that values are positive
  2.                 newR = Math.abs(newR);
  3.                 newG = Math.abs(newG);
  4.                 newB = Math.abs(newB);
  5.  
  6.                 // ensure that values are not out of range
  7.                 if (newR > 255) {
  8.                     newR = 255;
  9.                 }
  10.                 if (newG > 255) {
  11.                     newG = 255;
  12.                 }
  13.                 if (newB > 255) {
  14.                     newB = 255;
  15.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement