Skip to content

Conversation

@intergalacticspacehighway
Copy link
Contributor

@intergalacticspacehighway intergalacticspacehighway commented Feb 1, 2026

Summary:

Fixes - #53343. Passing transparent into text color renders black color text on android.

This broke with a fix implemented here. The issue is that if user passes transparent text color from JS, it gets converted to 0 value on platform. Currently, 0 is treated as Undefined on android, which causes this check to fail because bool override function returns false thinking the passed color is Undefined 😅 . Default text attribute is black color so android keeps the black color instead of overriding it with transparent.

This PR fixes it by removing the concept of Undefined platform color and introducing a defined property to SharedColor. This will make it consistent on different platforms. If user does SharedColor(), they'll get an undefined color (in bool checks) and SharedColor(red) would give a defined shared color.

Changelog:

[ANDROID] [FIXED] - Transparent text color renders black text.

Test Plan:

  • Added testcase to check the behaviour of undefined/defined and transparent color in ColorTest.cpp
  • Tested transparent/opaque color on Text on android and iOS.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 1, 2026
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Feb 1, 2026
// Non-obvious (can be different among platforms) default text attributes.
defaultAttrs.foregroundColor = blackColor();
defaultAttrs.backgroundColor = clearColor();
defaultAttrs.backgroundColor = SharedColor{};
Copy link
Contributor Author

@intergalacticspacehighway intergalacticspacehighway Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was needed to fix fantom tests. Fantom tests run on platform/cxx platform where clearColor was treated as false (same as android). iOS was treating it as true. So this also change makes it consistent on all platforms.

@intergalacticspacehighway intergalacticspacehighway force-pushed the fix/53343-android-transparent-color branch from af5d2be to f8597f4 Compare February 1, 2026 17:50
@intergalacticspacehighway intergalacticspacehighway force-pushed the fix/53343-android-transparent-color branch from f8597f4 to ab7f5e7 Compare February 1, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants