Using BufferedImage Create an image and draw it with darkGray color:
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB_PRE);
Graphics2D graphics = image.createGraphics();
Color darkGray = new Color(44, 47, 48);
graphics.setColor(darkGray);
graphics.fill(new RoundRectangle2D.Float(0, 0, image.getWidth(), image.getHeight(), ROUND_OF_CORNERS, ROUND_OF_CORNERS));
I want to change the image color using a different color presentation format, for example: # 2B2B2B (instead of the RGB format: 44, 47, 48).
source
share