mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[log] cleanup
This commit is contained in:
@@ -1,27 +1,26 @@
|
||||
package com.intellij.vcs.log.graph.render;
|
||||
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.vcs.log.graph.elements.Branch;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author erokhins
|
||||
*/
|
||||
public class ColorGenerator {
|
||||
private static final Map<Integer, Color> colorMap = new HashMap<Integer, Color>();
|
||||
|
||||
private static final Map<Branch, Color> ourCachedColors = new HashMap<Branch, Color>();
|
||||
private static final Map<Integer, Color> ourColorMap = ContainerUtil.newHashMap();
|
||||
|
||||
@NotNull
|
||||
public static Color getColor(@NotNull Branch branch) {
|
||||
int indexColor = branch.getBranchNumber();
|
||||
Color color = colorMap.get(indexColor);
|
||||
Color color = ourColorMap.get(indexColor);
|
||||
if (color == null) {
|
||||
color = getColor(indexColor);
|
||||
colorMap.put(indexColor, color);
|
||||
ourColorMap.put(indexColor, color);
|
||||
}
|
||||
return color;
|
||||
}
|
||||
@@ -30,7 +29,7 @@ public class ColorGenerator {
|
||||
return Math.abs(n) % 100 + 70;
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
private static Color getColor(int indexColor) {
|
||||
int r = indexColor * 200 + 30;
|
||||
int g = indexColor * 130 + 50;
|
||||
|
||||
Reference in New Issue
Block a user