This is what i got, a gui screen with a viewing panel and a sidebar that has sliders for (size, opacity, flow)
size is the size of the square that is drawn on the panel
opacity is its alpha
and flow is how far its alpha extends from the original square
the problem i have is when flow is up high, and the opacity is quite low (below 100), it decides to draw different colors than the color i have choosen (brown), i dont understand why my color changes when all i change is its alpha, heres my code snippet
public CustomPainter(information b, Graphics2D g){
this.b = b;
paint(g);
}
public void paint(Graphics2D g){
g.setColor(b.getColor());
g.fillRect(b.getLoc().x, b.getLoc().y, b.getSize(), b.getSize());
paintFlow(g);
}
public void paintFlow(Graphics2D g){
int flow = b.getFlow();
Color c = b.getColor();
for(int i=1;i<=flow;i++){
Color n = new Color(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()/i);
g.setColor(n);
g.fillRect(b.getLoc().x-(i*2), b.getLoc().y-(i*2), b.getSize()+(i*2)+(i*2), b.getSize()+(i*2)+(i*2));
}
}