LayeredIcon (JComponent component, NotificationType type, int size, boolean forToolWindow) { LayeredIcon icon = new LayeredIcon(2); Icon baseIcon = getPendingNotificationsIcon(type, forToolWindow); icon.setIcon(baseIcon, 0); if (size > 0) { //noinspection UseJBColor Color textColor = type == NotificationType.ERROR || type == NotificationType.INFORMATION ? new JBColor(Color.white, new Color(0xF2F2F2)) : new Color(0x333333); icon.setIcon(new TextIcon(component, size < 10 ? String.valueOf(size) : "9+", textColor, baseIcon), 1); } return icon; }