Skip to content

Commit

Permalink
import idea colors
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillp committed Dec 17, 2024
1 parent 707626e commit 1694b29
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ static GL.ImageData diffImage(
V4i s = stats(map);
System.out.println("codeMap built: l=" + map.length + ", 1: "
+ s.x + ", 2: " + s.y + ", 3: " + s.z + ", other: " + s.w);
System.out.println("colors DiffTypes.DELETED = " + colors.getDiffColor(DiffTypes.DELETED, null));
System.out.println("colors DiffTypes.INSERTED = " + colors.getDiffColor(DiffTypes.INSERTED, null));
System.out.println("colors DiffTypes.EDITED = " + colors.getDiffColor(DiffTypes.EDITED, null));
}
blurDiffImage(map);
applyDiffPalette(map, img, colors);
Expand Down Expand Up @@ -83,9 +86,9 @@ public static V4i stats(byte[] image) {
V4i r = new V4i();
for (byte b : image) {
switch (b) {
case 1 -> r.x++;
case 2 -> r.y++;
case 3 -> r.z++;
case DiffTypes.DELETED -> r.x++;
case DiffTypes.INSERTED -> r.y++;
case DiffTypes.EDITED -> r.z++;
default -> r.w++;
}
}
Expand Down Expand Up @@ -113,7 +116,7 @@ static void applyDiffPalette(
data[p++] = (byte) c.r;
data[p++] = (byte) c.g;
data[p++] = (byte) c.g;
data[p++] = (byte) (type == 0 ? 0 : -1);
data[p++] = (byte) c.a;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ public DiffColors(DiffColors c) {
this.editedColor2 = editedColor2;
}

public static DiffColors codeMapHandmade() {
return new DiffColors(
new Color("#f14c4c"),
new Color("#487e01"),
new Color("#1b81a8"),
new Color("#1b81a8")
);
}

public static DiffColors codeDiffDarcula() {
return new DiffColors(
new Color("#484A4A"),
Expand All @@ -39,15 +48,6 @@ public static DiffColors codeDiffDarcula() {
);
}

public static DiffColors codeDiffHandmade() {
return new DiffColors(
new Color("#f14c4c"),
new Color("#487e01"),
new Color("#1b81a8"),
new Color("#1b81a8")
);
}

public static DiffColors codeDiffDark() {
return new DiffColors(
new Color("#484A4A"),
Expand All @@ -57,6 +57,23 @@ public static DiffColors codeDiffDark() {
);
}

public static DiffColors codeMapDark() {
return new DiffColors(
new Color("#656E76"),
new Color("#447152"),
new Color("#43698D"));
}
public static DiffColors codeMapDarcula() {
return codeMapDark();
}

public static DiffColors codeMapLight() {
return new DiffColors(
new Color("#C8C8C8"),
new Color("#AADEAA"),
new Color("#B6D2F2"));
}

public static DiffColors codeDiffLight() {
return new DiffColors(
new Color("#D6D6D6"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ public static EditorColorScheme darculaIdeaColorScheme() {
IdeaCodeColors.codeElementColorsDarcula(),
LineNumbersColors.darcula(),
Themes.darculaColorScheme(),
DiffColors.codeDiffDarcula());
DiffColors.codeDiffDarcula(),
// DiffColors.codeMapDarcula()
DiffColors.codeMapHandmade()
);
}

public static EditorColorScheme darkIdeaColorScheme() {
Expand All @@ -87,7 +90,8 @@ public static EditorColorScheme darkIdeaColorScheme() {
LineNumbersColors.dark(),
Themes.darkColorScheme(),
DiffColors.codeDiffDark(),
DiffColors.codeDiffHandmade());
DiffColors.codeMapDark()
);
}

public static EditorColorScheme lightIdeaColorScheme() {
Expand All @@ -97,7 +101,8 @@ public static EditorColorScheme lightIdeaColorScheme() {
IdeaCodeColors.codeElementColorsLight(),
LineNumbersColors.light(),
Themes.lightColorScheme(),
DiffColors.codeDiffLight()
DiffColors.codeDiffLight(),
DiffColors.codeMapLight()
);
}

Expand Down

0 comments on commit 1694b29

Please sign in to comment.