[
https://issues.apache.org/jira/browse/NETBEANS-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17029889#comment-17029889
]
Karl Tauber commented on NETBEANS-3739:
---------------------------------------
This happens also in other LAFs when using custom colors. E.g. go to "Options >
Fonts & Colors > Git" and change "Modified in working tree" color to "Cyan".
Then the same happens in Windows LAF and FlatLaf Light (and probably in all
other light LAFs too).
After debugging for some hours I've found the reason. It is in
[HtmlLabelUI.ensureContrastingColor(Color fg, Color
bg)|https://github.com/apache/netbeans/blob/b4413352033a7da5ba6ba794a2b8110d643ae8a3/platform/openide.awt/src/org/openide/awt/HtmlLabelUI.java#L375-L426],
which compares the luminance of the foreground and background colors. If the
difference is smaller than 80 (max is 255), then either black or white is
returned.
In case of FlatLaf Dark, the luminance difference is 73 for modified and 65 for
ignored files.
I think a reasonable solution is to lower the luminance difference limit from
80 to 60.
I'll create a PR...
> Strange Versioning Colors in FlatLafDark
> ----------------------------------------
>
> Key: NETBEANS-3739
> URL: https://issues.apache.org/jira/browse/NETBEANS-3739
> Project: NetBeans
> Issue Type: Bug
> Reporter: Laszlo Kishalmi
> Assignee: Karl Tauber
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The Project/File view Versioning colors are displayed as white for
> modified/ignored files.
> They are displayed right (green) for added ones.
> It's only happening on FlatLaf Dark. FlatLafLight are displaying the those
> files correctly. I've checked the AnnotationColorProvider, is seems to
> generate the annotations fine, for ignored.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists