Merged
Conversation
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR systematically fixes color rendering issues in dark mode by refactoring hardcoded colors to use CSS theme variables. The changes introduce a brightness-specific stylesheet system and migrate color values from Java code to CSS, ensuring proper theming support across light and dark modes.
Key Changes
- Introduced brightness-specific stylesheets: Created
brightness-light.cssandbrightness-dark.cssfiles with-fixed-prefixed CSS variables for colors that differ between light and dark modes - Removed hardcoded colors from Java: Eliminated direct color assignments in Java code (e.g.,
Color.web("#0070E0")) in favor of CSS styling - Enhanced dynamic color binding: Implemented proper property binding for UI elements that need to react to theme changes (e.g., title text fill)
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| HMCLCore/src/main/java/org/jackhuang/hmcl/util/Log4jLevel.java | Removed unused Color constants and getColor() method from enum |
| HMCL/src/main/resources/assets/css/root.css | Replaced hardcoded color values with CSS theme variables; added brightness-agnostic styles |
| HMCL/src/main/resources/assets/css/brightness-light.css | New file defining light mode specific colors using -fixed- prefix |
| HMCL/src/main/resources/assets/css/brightness-dark.css | New file defining dark mode specific colors using -fixed- prefix |
| HMCL/src/main/resources/assets/css/blue.css | Removed hardcoded -warning-tag-background (now in brightness files) |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaControllerPage.java | Added style classes for CSS targeting; contains one hardcoded color that needs fixing |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java | Bound title text fill to dynamic theme property |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java | Bound title text fill to dynamic theme property |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedMenuItem.java | Added size limiting for icon consistency |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/LogWindow.java | Migrated log level colors from Java to CSS class-based styling |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java | Removed hardcoded hyperlink color to use CSS styling |
| HMCL/src/main/java/org/jackhuang/hmcl/theme/Themes.java | Implemented dynamic title fill property with transparency support |
| HMCL/src/main/java/org/jackhuang/hmcl/setting/StyleSheets.java | Added brightness stylesheet loading and update logic |
| HMCL/src/main/java/com/jfoenix/skins/JFXCustomColorPickerDialog.java | Commented out hardcoded color logic (replaced by CSS) |
| HMCL/src/main/java/com/jfoenix/skins/JFXColorPickerSkin.java | Refactored to use properties for proper binding and CSS compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaControllerPage.java
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.