-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRejectingPix.java
More file actions
53 lines (50 loc) · 786 Bytes
/
RejectingPix.java
File metadata and controls
53 lines (50 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* Class RejectingPix
* @author Nic Manoogian <zimmoz3@verizon.net>
* @author Mike Lyons
*/
public class RejectingPix extends Pix
{
/**
* Default constructor
* Calls Pix()
*/
public RejectingPix()
{
super();
}
/**
* Gets closer to interacted Pix color
* Causes blurring...
*/
public void interact(Pix p)
{
// Get further from red
if (p.getRed() > red && red > 0)
{
red--;
}
else if (p.getRed() < red && red < 255)
{
red++;
}
// Get further from green
if (p.getGreen() > green && green > 0)
{
green--;
}
else if (p.getGreen() < green && green < 255)
{
green++;
}
// Get further from blue
if (p.getBlue() > blue && blue > 0)
{
blue--;
}
else if (p.getBlue() < blue && blue < 255)
{
blue++;
}
}
}