Skip to content

Conversation

@ansarikhurshid786
Copy link

@ansarikhurshid786 ansarikhurshid786 commented Sep 8, 2025

Summary

This PR introduces an optional feature to auto-adapt the foreground (text/icon) color of items inside LiquidGlassView based on the backdrop luminance.

  • Adds a new prop: adaptiveContentColor?: boolean (default: false)
  • Adds an event: onForegroundColorChange?: (color: string) => void
  • On iOS 26+, the view samples the underlying content and emits a suggested color (black/white or tinted blend).
  • No behavior changes unless the prop is enabled.
  • On unsupported platforms, the prop is accepted but has no effect (matches existing fallback pattern).

This addresses #7 – Auto-change contained item color.

Test plan

  1. Run the example app
  2. Open the new screen AdaptiveContentColorExample.
  3. Observe text/icons inside LiquidGlassView adapt between light/dark as the backdrop changes.
  4. Toggle the adaptiveContentColor prop to compare behavior.
  5. Confirm that on Android/older iOS, the prop has no effect (children use their explicit color).

@okwasniewski
Copy link
Member

Hey, can you provide some screenshots?

I tried building the code but run into a build issue. No known class method for selector 'effectWithStyle:'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants