Skip to content

Commit fded8b0

Browse files
committed
fix: adjust colors
1 parent b48725e commit fded8b0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/main/kotlin/com/github/xepozz/git_churn/Colors.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ object Colors {
77
val darkGrey = ColorUtil.fromHex("#AFB1B3")
88

99
val lightRed = ColorUtil.fromHex("#DB5860")
10-
val darkRed = ColorUtil.fromHex("#C75450")
10+
val darkRed = ColorUtil.fromHex("#5E2C2A")
1111

1212
fun getGreyColor(isDarkThemeActive: Boolean) = if (isDarkThemeActive) darkGrey else lightGrey
1313
fun getRedColor(isDarkThemeActive: Boolean) = if (isDarkThemeActive) darkRed else lightRed

src/main/kotlin/com/github/xepozz/git_churn/FileNodeDecorator.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FileNodeDecorator(val project: Project) : ProjectViewNodeDecorator {
3636
val fileNodeDescriptor = fileSystemService.findDescriptor(virtualFile) ?: return
3737
if (fileNodeDescriptor.changeCount == 0) return
3838

39-
val isDarkThemeActive = JBColor.isBright()
39+
val isDarkThemeActive = !JBColor.isBright()
4040

4141
val greyColor = Colors.getGreyColor(isDarkThemeActive)
4242
val redColor = Colors.getRedColor(isDarkThemeActive)
@@ -52,12 +52,14 @@ class FileNodeDecorator(val project: Project) : ProjectViewNodeDecorator {
5252
?: (parentDescriptor as? PresentableNodeDescriptor)?.highlightColor
5353
?: greyColor
5454

55-
presentation.background = gradientStep(
55+
val gradientColor = gradientStep(
5656
backgroundColor,
5757
redColor,
5858
fileNodeDescriptor.changeCount,
5959
maxSteps,
6060
)
61+
62+
presentation.background = gradientColor
6163
}
6264

6365
add(GitChurnBundle.message("changes", fileNodeDescriptor.changeCount))
@@ -71,7 +73,7 @@ class FileNodeDecorator(val project: Project) : ProjectViewNodeDecorator {
7173

7274
fun gradientStep(fromColor: java.awt.Color, toColor: java.awt.Color, step: Int, maxSteps: Int): java.awt.Color {
7375
val ratio = step.toDouble() / maxSteps.toDouble()
74-
val clampedRatio = ratio.coerceIn(0.0, 0.7)
76+
val clampedRatio = ratio.coerceIn(0.05, 1.0)
7577

7678
return ColorUtil.mix(fromColor, toColor, clampedRatio)
7779
}

0 commit comments

Comments
 (0)