EditorColorsManager manager = EditorColorsManager.getInstance();
TextAttributes trueAttrs = manager.getGlobalScheme().getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES);
TextAttributes falseAttrs = manager.getGlobalScheme().getAttributes(EditorColors.WRITE_SEARCH_RESULT_ATTRIBUTES);
HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project);
highlightManager.hideHighlights(grammarEditor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY);
for (TextRange range : trueRanges) {
highlightManager.addRangeHighlight(grammarEditor, range.getStartOffset(), range.getEndOffset(), trueAttrs, true, null);
}
for (TextRange range : falseRanges) {
highlightManager.addRangeHighlight(grammarEditor, range.getStartOffset(), range.getEndOffset(), falseAttrs, true, null);