Skip to content

alpha ignored in modern rgb() syntax #50207

@wojtekmaj

Description

@wojtekmaj

Description

rgb() syntax appears to be only parsing R, G, and B channels, ignoring A, despite specs allowing it and all web browsers respecting it.

Steps to reproduce

  1. Use rgb(R G B / A) color anywhere in the code
  2. You get black instead

React Native Version

0.78.1

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.3.1
  CPU: (8) arm64 Apple M2
  Memory: 221.89 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.14.0
    path: /private/var/folders/3y/swkjq1x101b76mzjgt4pm2d80000gp/T/xfs-39046bc3/node
  Yarn:
    version: 4.3.1
    path: /private/var/folders/3y/swkjq1x101b76mzjgt4pm2d80000gp/T/xfs-39046bc3/yarn
  npm:
    version: 10.9.2
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.6
    wanted: 0.76.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

not applicable

Reproducer

https://snack.expo.dev/u9FC-9ROpkNTvjfeWs6C6

Screenshots and Videos

Image

Source: https://snack.expo.dev/u9FC-9ROpkNTvjfeWs6C6

Trying the exact same code on the web (minimally edited for obvious reasons) works:

Image

Source: https://codesandbox.io/p/devbox/distracted-pond-k68g7k / https://k68g7k.csb.app/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions