RFR: JDK-8293776 : Adds CSS 4 and 8 digits hex coded Color [v6]

ScientificWare duke at openjdk.org
Sat Sep 24 00:51:17 UTC 2022


On Fri, 23 Sep 2022 17:08:33 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> I'm going to work on rgb() and rgba() notations (https://bugs.openjdk.org/browse/JDK-8294090). Could we let this unchanged or differ this change ?
>
>> I'm going to work on rgb() and rgba() notations (https://bugs.openjdk.org/browse/JDK-8294090). Could we let this unchanged or differ this change ?
> 
> How is this comment related to the `rgb()` and `rgba()` functions?
> 
> I think using `color.getRGB()` and comparing the value to a hex-number representing the colour (with the alpha byte moved to the higher byte of the double word) is concise and clear.
> 
> My other point was that you still validate the red, green and blue components of the color but you don't read them from the color parsed on line 68. If you don't update `red`, `green` and `blue`, they're not changed, verifying the values for the second time won't catch an error even if `styleSheet.stringToColor` returned a different color.

Big mistake. I forgot to update red, green and blue when I extended the test to these values. Anyway I'm going to apply your suggestion.

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

PR: https://git.openjdk.org/jdk/pull/10317



More information about the client-libs-dev mailing list