Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ensure that values are positive
- newR = Math.abs(newR);
- newG = Math.abs(newG);
- newB = Math.abs(newB);
- // ensure that values are not out of range
- if (newR > 255) {
- newR = 255;
- }
- if (newG > 255) {
- newG = 255;
- }
- if (newB > 255) {
- newB = 255;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement