Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int r = 255; // Default color to red.
- private int g = 0;
- private int b = 0;
- private void nextRGB() {
- if (r == 255 && g < 255 && b == 0)
- g += 15;
- if (g == 255 && r > 0 && b == 0)
- r -= 15;
- if (g == 255 && b < 255 && r == 0)
- b += 15;
- if (b == 255 && g > 0 && r == 0)
- g -= 15;
- if (b == 255 && r < 255 && g == 0)
- r += 15;
- if (r == 255 && b > 0 && g == 0)
- b -= 15;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement