mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44624 The syntax for <color> is defined as (https://www.w3.org/TR/css-color-4/#color-syntax): ``` <color> = <color-base> | currentColor | <system-color> <color-base> = <hex-color> | <color-function> | <named-color> | transparent <color-function> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <color()> ``` This diff implements in particular: ``` <color-base> = <hex-color> ``` We parse over a `<hash-token>` to extract a 3, 4, 6 or 8 digit long hexadecimal and parse it into a CSSColor struct representation: ``` struct Color { uint8_t r // 0-255 uint8_t g // 0-255 uint8_t b // 0-255 uint8_t a // 0.0 - 1.0 } ``` Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D57287309 fbshipit-source-id: 35ce82e52fdc8fc86425e03d7883ae09b429b9e4