RFR: JDK-8292276 : Missing color names in CSS [v23]
ScientificWare
duke at openjdk.org
Wed Sep 28 21:57:21 UTC 2022
On Wed, 28 Sep 2022 17:13:42 GMT, ScientificWare <duke at openjdk.org> wrote:
>> This is referenced in Java Bug Database as
>> - [JDK-8292276 : Missing color names in CSS](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8292276)
>>
>> This is tracked in JBS as
>> - [JDK-8292276 : Missing color names in CSS](https://bugs.openjdk.java.net/browse/JDK-8292276)
>>
>> Adds missing color names, defined by CSS Level 4, in CSS.java :
>> CSS Color Module Level 4
>> W3C Candidate Recommendation Snapshot, 5 July 2022
>> [7.1 Named Colors](https://www.w3.org/TR/css-color-4/#named-color)
>>
>> Designed from : [ScientificWare JDK-8292276 : Missing color names in CSS](https://github.com/scientificware/jdk/issues/12)
>
> ScientificWare has updated the pull request incrementally with one additional commit since the last revision:
>
> Moves jtreg tags to the class declaration
>
> Comment with tags isn't collapsed when viewed in an IDE if it's placed before the class declaration.
1. > Should it be an enhancement?
This PR
- corrects or changes `Orange` value in (bug ?)
- adds new values + improve performance (enhancements)
So I think it's rather an enhancement.
Why is it important to qualifying this ?
2. Could we consider once more times @SWinxy 's Aug 16 comment about color instance ?
```
...
String color = colorNames.get(strlc);
if (color != null) {
return hexToColor(color);
}
// sometimes get specified without leading #
return hexToColor(str);
}
}
private static final Map<String, String> colorNames =
Map.ofEntries(
Map.entry("aliceblue", "#f0f8ff")),
Map.entry("antiquewhite", "#faebd7"),
Map.entry("aqua", "#00ffff"),
...
```
Another way to proceed would be that Map returns the `int value` of the color, then we can return a `new Color(value)`.
-------------
PR: https://git.openjdk.org/jdk/pull/9825
More information about the client-libs-dev
mailing list