<Swing Dev> RFR: 8256019: JLabel HTML text does not support translucent text colors [v3]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Tue Nov 24 13:02:12 UTC 2020


On Tue, 24 Nov 2020 04:58:37 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> The problem is the alpha color not being present in c.getForeground() so we need to parse alpha here to pass the value to displayPropertiesToCSS(). I have already mentioned it below.
>
> As far as I understand the only place where we decode `rgb()` is `CSS.stringToColor` and that code missing the `rgba()` case.
> Just to double-check.
> If the test case `TestTranslucentLabelText` will be modified to use `rgb()` instead of `rgba()` then the color which was set by the user to the `Component` will be ignored, and the correct color from the `rgb()` will be used. So it does not matter that `c.getForeground()` contains some opaque color, it is ignored, why the similar case for` rgba()` does not work in the same way?

Yes, seems like overkill last time which is not needed. Reverted back unneeded code.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1158


More information about the swing-dev mailing list