Skip to content

fillOpacity not working with fill="currentColor" #1802

@robrechtme

Description

@robrechtme

Bug

Using fillOpacity in combination with fill="currentColor" does not work on iOS and Android. On web it shows expected behaviour.

<Svg width="56" height="56" viewBox="0 0 56 56" color="red">

  {/* ✅ Works: renders at 20% opacity */}
  <Rect x="25" y="25" width="20" height="20" rx="4" fill="red" fillOpacity="0.2" />

  {/* ❌ Expected: renders at 20% opacity; Actual: renders at full opacity */}
  <Rect width="20" height="20" rx="4" fill="currentColor" fillOpacity="0.2" />

  {/* ✅ Works: renders at zero opacity */}
  <Rect width="20" height="20" rx="4" fill="currentColor" fillOpacity="0" />
 </Svg>

Environment info

Expo 45 (RN 0.68.2), same on RN bare 0.68.2
Library version: 12.3.0

Short, Self Contained, Correct (Compilable), Example

https://snack.expo.dev/@robrechtme/bug-react-native-svg-currentcolor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions