Files
react-native/packages
Nick GerlemanandFacebook GitHub Bot 8803dca0bb Support parsing rgb() and rgba() functions into CSSColor (#48827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48827

This teaches the CSSColor parser how to handle these functions.

There are a surprising amount of edge cases here, including many syntactic options added by the CSS Color Module 4 spec, and some technically invalid examples supported by normalize-color, sometimes working in Chrome.

I used the combination of the spec, and existing functionality and tests for `normalize-color`, with the end result supporting a superset of the functionality of both, while being a bit more permissive than either.

I still need to add support for the other color functions, and will probably want to share code here, but for now, just implemented everything for the rgb values as a start.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68362477

fbshipit-source-id: 62973ba2f8361b6a43c7cf9a96029147f84582d2
2025-01-21 20:20:04 -08:00
..
2025-01-16 02:57:24 -08:00
2025-01-20 12:20:36 -08:00