int ev = p.getDetalleVisita().getEstilo().getNumero();
for (int i = 0; i < 7; i++) {
imgLocal[i] = ImageIO.read(getClass().getResource("/imagenes/jugador/" + el + "" + i + ".png"));
imgVisita[i] = ImageIO.read(getClass().getResource("/imagenes/jugador/" + ev + "" + i + ".png"));
}
TacticaDetalle impl = p.getDetalleLocal();
int upolera;
int upantalon;
int ucalcetas;
int ufranja;
upolera = new Color(impl.getColorCamiseta().getRed(), impl.getColorCamiseta().getGreen(), impl.getColorCamiseta().getBlue()).getRGB();
upantalon = new Color(impl.getColorPantalon().getRed(), impl.getColorPantalon().getGreen(), impl.getColorPantalon().getBlue()).getRGB();
ucalcetas = new Color(impl.getColorCalcetas().getRed(), impl.getColorCalcetas().getGreen(), impl.getColorCalcetas().getBlue()).getRGB();
ufranja = new Color(impl.getColorFranja().getRed(), impl.getColorFranja().getGreen(), impl.getColorFranja().getBlue()).getRGB();
int upelo = Color.black.getRGB();
{
BufferedImage buf = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);
Graphics gr = buf.getGraphics();
gr.setColor(new Color(upolera));
gr.fillArc(3, 3, 13, 13, 0, 180);
gr.setColor(new Color(upantalon));
gr.fillArc(3, 3, 13, 13, 180, 180);
gr.setColor(new Color(ufranja));
gr.drawOval(2, 2, 15, 15);
imgLoc = buf.getScaledInstance(20, 20, Image.SCALE_SMOOTH);
}
for (int k = 0; k < 7; k++) {
BufferedImage buf = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);
buf.getGraphics().drawImage(imgLocal[k], 0, 0, null);
for (int i = 0; i < 20; i++) {
for (int j = 0; j < 20; j++) {
int color = buf.getRGB(i, j);
if (color == polera) {
buf.setRGB(i, j, upolera);
} else if (color == pantalon) {
buf.setRGB(i, j, upantalon);
} else if (color == calcetas) {
buf.setRGB(i, j, ucalcetas);
} else if (color == franja) {
buf.setRGB(i, j, ufranja);
} else if (color == pelo) {
buf.setRGB(i, j, upelo);
}
}
}
imgLocal[k] = buf.getScaledInstance(20, 20, Image.SCALE_SMOOTH);
}
impl = p.getDetalleVisita();
if (!uniformeAlternativo) {
ucalcetas = new Color(impl.getColorCalcetas().getRed(), impl.getColorCalcetas().getGreen(), impl.getColorCalcetas().getBlue()).getRGB();
upantalon = new Color(impl.getColorPantalon().getRed(), impl.getColorPantalon().getGreen(), impl.getColorPantalon().getBlue()).getRGB();
upolera = new Color(impl.getColorCamiseta().getRed(), impl.getColorCamiseta().getGreen(), impl.getColorCamiseta().getBlue()).getRGB();
ufranja = new Color(impl.getColorFranja().getRed(), impl.getColorFranja().getGreen(), impl.getColorFranja().getBlue()).getRGB();
} else {
ucalcetas = new Color(impl.getColorCalcetas2().getRed(), impl.getColorCalcetas2().getGreen(), impl.getColorCalcetas2().getBlue()).getRGB();
upantalon = new Color(impl.getColorPantalon2().getRed(), impl.getColorPantalon2().getGreen(), impl.getColorPantalon2().getBlue()).getRGB();
upolera = new Color(impl.getColorCamiseta2().getRed(), impl.getColorCamiseta2().getGreen(), impl.getColorCamiseta2().getBlue()).getRGB();
ufranja = new Color(impl.getColorFranja2().getRed(), impl.getColorFranja2().getGreen(), impl.getColorFranja2().getBlue()).getRGB();
}
{
BufferedImage buf = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);
Graphics gr = buf.getGraphics();
gr.setColor(impl.getColorCamiseta());
gr.fillArc(4, 4, 11, 11, 0, 180);
gr.setColor(impl.getColorPantalon());
gr.fillArc(4, 4, 11, 11, 180, 180);
gr.setColor(impl.getColorFranja());
gr.drawOval(2, 2, 15, 15);
imgVis = buf.getScaledInstance(20, 20, Image.SCALE_SMOOTH);
}
for (int k = 0; k < 7; k++) {
BufferedImage buf = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);