On Fri, 23 Sep 2022 04:06:48 GMT, ScientificWare <d...@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 ?

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.

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

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

Reply via email to