feat(renderer): adjust hover brightness logic for improved text visibility

This commit is contained in:
extio-de
2025-12-29 13:08:23 +01:00
parent 52219772d1
commit 2ebb8aafda

View File

@@ -187,11 +187,16 @@ public class CustomLabel extends Component {
b = theme.getSelectionPrimary().getBrightness() + theme.getPressedBrightnessAdjustment(); b = theme.getSelectionPrimary().getBrightness() + theme.getPressedBrightnessAdjustment();
} }
else if ((this.state & STATE_HOVERED) != 0) { else if ((this.state & STATE_HOVERED) != 0) {
if (theme.getTextNormal().getBrightness() > 0.85f) {
b -= theme.getHoverBrightnessAdjustment();
}
else {
b += theme.getHoverBrightnessAdjustment(); b += theme.getHoverBrightnessAdjustment();
if (theme.getTextNormal().getBrightness() < 0.3f) { if (theme.getTextNormal().getBrightness() < 0.3f) {
b += theme.getHoverBrightnessAdjustment(); b += theme.getHoverBrightnessAdjustment();
} }
} }
}
h = Math.max(0.0f, Math.min(1.0f, h)); h = Math.max(0.0f, Math.min(1.0f, h));
s = Math.max(0.0f, Math.min(1.0f, s)); s = Math.max(0.0f, Math.min(1.0f, s));