[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: JDK-8293776 : Adds CSS 4 and 8 digits hex coded Color [v13]
From:       Alexey Ivanov <aivanov () openjdk ! org>
Date:       2023-02-28 16:02:47
Message-ID: QkfdMu_83bZZ2NooqAmfc0KwI2hBrvdRLcLBj7fbJuU=.b45f8725-d943-4600-8ff3-c08097caa2bc () github ! com
[Download RAW message or body]

On Sun, 5 Feb 2023 09:55:27 GMT, ScientificWare <duke@openjdk.org> wrote:

> > This is referenced in Java Bug Database as
> > - [JDK-8293776 : Adds CSS 4 and 8 digits hex coded \
> > Color](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8293776) 
> > This is tracked in JBS as 
> > - [JDK-8293776 : Adds CSS 4 and 8 digits hex coded \
> > Color](https://bugs.openjdk.java.net/browse/JDK-8293776) 
> > Adds the 4 and 8 digits color hex notations to CSS.java, as described in :
> > CSS Color Module Level 4
> > W3C Candidate Recommendation Snapshot, 5 July 2022
> > [6.2 The RGB Hexadecimal Notations: \
> > `#RRGGBB`](https://www.w3.org/TR/css-color-4/#hex-notation) 
> > Designed from : [ScientificWare JDK-8293776 : Adds CSS 4 and 8 digits hex coded \
> > Color](https://github.com/scientificware/jdk/issues/13)
> 
> ScientificWare has updated the pull request incrementally with two additional \
> commits since the last revision: 
> - Updates copyright date.
> 
> Updates copyright date to 2023.
> - Updates copyright date.
> 
> Updates copyright date to 2023.

Changes requested by aivanov (Reviewer).

src/java.desktop/share/classes/javax/swing/text/html/CSS.java line 1382:

> 1380:             value = dv | value << 4;
> 1381:         }
> 1382:         return new Color(value, true);

I wonder if it can be written in a clearer way. It looks cool yet not straightforward \
at all, so it requires explaining what's going on.

I guess a previous versions was clearer. However, I grasped how it works.

I would rather avoid assigning values inside the if-condition and extract the \
assignments into separate line.

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic