void (Component component, Graphics g, final int left, final int top) { int iconWidth = getIconWidth(); int iconHeight = getIconHeight(); if (component instanceof SimpleColoredComponent coloredComponent) { g.setColor(component.getBackground()); g.fillRect(left - coloredComponent.getIpad().left, 0, iconWidth + coloredComponent.getIpad().left + coloredComponent.getIconTextGap(), component.getHeight()); } int x = left + (int)floor((iconWidth - scaleVal(myColorSize)) / 2); int y = top + (int)floor((iconHeight - scaleVal(myColorSize)) / 2); g.setColor(myColor); g.fillRect(x, y, (int)ceil(scaleVal(myColorSize)), (int)ceil(scaleVal(myColorSize))); if (myShowRedLine) { Graphics2D g2d = (Graphics2D)g; Object hint = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setColor(JBColor.red); g.drawLine(x, y + (int)floor(scaleVal(myColorSize)), x + (int)floor(scaleVal(myColorSize)), y); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, hint); } g.setColor(Color.BLACK); g.drawRect(x, y, (int)ceil(scaleVal(myColorSize)), (int)ceil(scaleVal(myColorSize))); }