Color (boolean isSelected, LookupElementPresentation.TextFragment fragment, Color defaultForeground, boolean nonFocusedSelection) { if (nonFocusedSelection) { return defaultForeground; } if (fragment.isGrayed()) { return getGrayedForeground(isSelected); } if (!isSelected) { final Color tailForeground = fragment.getForegroundColor(); if (tailForeground != null) { return tailForeground; } } return defaultForeground; }