use of com.intellij.openapi.editor.colors.ColorKey in project intellij-community by JetBrains.
the class XmlTagTreeHighlightingUtil method getBaseColors.
static Color[] getBaseColors() {
final ColorKey[] colorKeys = XmlTagTreeHighlightingColors.getColorKeys();
final Color[] colors = new Color[colorKeys.length];
final EditorColorsScheme colorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
for (int i = 0; i < colors.length; i++) {
colors[i] = colorsScheme.getColor(colorKeys[i]);
}
return colors;
}
use of com.intellij.openapi.editor.colors.ColorKey in project intellij-community by JetBrains.
the class AnnotationsSettings method getAnchorIndexes.
@NotNull
List<Integer> getAnchorIndexes(@Nullable EditorColorsScheme scheme) {
if (scheme == null)
scheme = EditorColorsManager.getInstance().getGlobalScheme();
List<Integer> result = new ArrayList<>(ANCHORS_COUNT);
int count = 0;
for (ColorKey key : ANCHOR_COLOR_KEYS) {
if (scheme.getColor(key) != null) {
result.add(count);
count += COLORS_BETWEEN_ANCHORS + 1;
} else {
result.add(null);
}
}
return result;
}
use of com.intellij.openapi.editor.colors.ColorKey in project intellij-community by JetBrains.
the class VcsColorsPageFactory method getColorDescriptors.
@Override
@NotNull
public ColorDescriptor[] getColorDescriptors() {
List<ColorDescriptor> descriptors = new ArrayList<>();
descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.added.lines"), EditorColors.ADDED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.modified.lines"), EditorColors.MODIFIED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.deleted.lines"), EditorColors.DELETED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.whitespaces.modified.lines"), EditorColors.WHITESPACES_MODIFIED_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.border.lines"), EditorColors.BORDER_LINES_COLOR, ColorDescriptor.Kind.BACKGROUND));
descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.vcs.annotations"), EditorColors.ANNOTATIONS_COLOR, ColorDescriptor.Kind.FOREGROUND));
List<ColorKey> colorKeys = AnnotationsSettings.ANCHOR_COLOR_KEYS;
for (int i = 0; i < colorKeys.size(); i++) {
descriptors.add(new ColorDescriptor(OptionsBundle.message("options.general.color.descriptor.vcs.annotations.color.n", i + 1), colorKeys.get(i), ColorDescriptor.Kind.BACKGROUND));
}
return ArrayUtil.toObjectArray(descriptors, ColorDescriptor.class);
}
use of com.intellij.openapi.editor.colors.ColorKey in project intellij-community by JetBrains.
the class EditorGutterComponentImpl method getOutlineColor.
private Color getOutlineColor(boolean isActive) {
ColorKey key = isActive ? EditorColors.SELECTED_TEARLINE_COLOR : EditorColors.TEARLINE_COLOR;
Color color = myEditor.getColorsScheme().getColor(key);
return color != null ? color : JBColor.black;
}
use of com.intellij.openapi.editor.colors.ColorKey in project intellij-community by JetBrains.
the class EditorColorsSchemeImpl method compareColors.
private boolean compareColors(@NotNull AbstractColorsScheme otherScheme, @NotNull Collection<Function<ColorKey, Boolean>> filters) {
for (ColorKey key : myColorsMap.keySet()) {
Color thisColor = getColor(key);
Color otherColor = otherScheme.getColor(key);
if (thisColor == null) {
return otherColor == null;
}
if (!isColorKeyIgnored(filters, key) && !thisColor.equals(otherColor)) {
return false;
}
}
filters.add(key -> myColorsMap.containsKey(key));
if (myParentScheme instanceof EditorColorsSchemeImpl && !((EditorColorsSchemeImpl) myParentScheme).compareColors(otherScheme, filters)) {
return false;
}
return true;
}
Aggregations