Skip to content

Commit a31a8ea

Browse files
committed
Increase transparency levels for diff highlighting.
Updated the alpha values for added, deleted, and changed diff types across multiple components to enhance visibility. This improves the user experience by making the highlighting more prominent without compromising design subtlety.
1 parent 76351d7 commit a31a8ea

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

app/src/main/java/dev/jahidhasanco/diffly/presentation/component/InlineCharDiffText.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ fun InlineCharDiffText(
4646
}
4747

4848
val backgroundColor = when (charDiffs.getOrNull(i)?.type) {
49-
CharDiffType.INSERTED -> added.copy(alpha = 0.2f)
50-
CharDiffType.DELETED -> delete.copy(alpha = 0.2f)
49+
CharDiffType.INSERTED -> added.copy(alpha = 0.3f)
50+
CharDiffType.DELETED -> delete.copy(alpha = 0.3f)
5151
CharDiffType.UNCHANGED -> Color.Transparent
5252
else -> Color.Transparent
5353
}

app/src/main/java/dev/jahidhasanco/diffly/presentation/component/SeparateCharDiffText.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fun SeparateCharDiffText(
7171
}
7272
val color = when (entry.type) {
7373
DiffType.ADDED, DiffType.DELETED, DiffType.CHANGED -> delete.copy(
74-
alpha = 0.05f
74+
alpha = 0.1f
7575
)
7676

7777
else -> Color.Unspecified
@@ -146,7 +146,7 @@ fun SeparateCharDiffText(
146146
}
147147
val color = when (entry.type) {
148148
DiffType.ADDED, DiffType.DELETED, DiffType.CHANGED -> added.copy(
149-
alpha = 0.05f
149+
alpha = 0.1f
150150
)
151151

152152
else -> Color.Unspecified

app/src/main/java/dev/jahidhasanco/diffly/presentation/component/TwoSIdeCharDiffText.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ fun TwoSideCharDiffText(
6969
val color =
7070
entry.type.takeIf { it != DiffType.UNCHANGED }?.let {
7171
when (it) {
72-
DiffType.ADDED -> delete.copy(alpha = 0.05f)
73-
DiffType.DELETED -> delete.copy(alpha = 0.05f)
74-
DiffType.CHANGED -> delete.copy(alpha = 0.05f)
72+
DiffType.ADDED -> delete.copy(alpha = 0.1f)
73+
DiffType.DELETED -> delete.copy(alpha = 0.1f)
74+
DiffType.CHANGED -> delete.copy(alpha = 0.1f)
7575
else -> Color.Unspecified
7676
}
7777
} ?: Color.Unspecified
@@ -146,9 +146,9 @@ fun TwoSideCharDiffText(
146146
val color =
147147
entry.type.takeIf { it != DiffType.UNCHANGED }?.let {
148148
when (it) {
149-
DiffType.ADDED -> added.copy(alpha = 0.05f)
150-
DiffType.DELETED -> added.copy(alpha = 0.05f)
151-
DiffType.CHANGED -> added.copy(alpha = 0.05f)
149+
DiffType.ADDED -> added.copy(alpha = 0.1f)
150+
DiffType.DELETED -> added.copy(alpha = 0.1f)
151+
DiffType.CHANGED -> added.copy(alpha = 0.1f)
152152
else -> Color.Unspecified
153153
}
154154
} ?: Color.Unspecified

app/src/main/java/dev/jahidhasanco/diffly/presentation/component/UnifiedCharDiffText.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ fun UnifiedCharDiffText(
6363
}
6464

6565
val color = when (entry.type) {
66-
DiffType.ADDED -> added.copy(alpha = 0.05f)
67-
DiffType.DELETED -> delete.copy(alpha = 0.05f)
68-
DiffType.CHANGED -> delete.copy(alpha = 0.05f)
66+
DiffType.ADDED -> added.copy(alpha = 0.1f)
67+
DiffType.DELETED -> delete.copy(alpha = 0.1f)
68+
DiffType.CHANGED -> delete.copy(alpha = 0.1f)
6969
else -> Color.Transparent
7070
}
7171

0 commit comments

Comments
 (0)