Color (@NotNull Editor editor, boolean useCaretRowBackground) { EditorColorsScheme colorsScheme = editor.getColorsScheme(); Color color = colorsScheme.getColor(EditorColors.CARET_ROW_COLOR); if (!useCaretRowBackground || color == null){ color = editor instanceof EditorEx ? ((EditorEx)editor).getBackgroundColor() : colorsScheme.getDefaultBackground(); } return color; }