Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose "fallbck" tint logic #117

Open
almozavr opened this issue Jan 31, 2024 · 0 comments
Open

Expose "fallbck" tint logic #117

almozavr opened this issue Jan 31, 2024 · 0 comments

Comments

@almozavr
Copy link
Contributor

Information

  • Haze version: 0.5.0
  • Platform: Android

Context

If blur is not supported (e.g. <=31), Haze applies additional transformation to the tint color provided – boosts alpha.

private fun Color.boostAlphaForBlurRadius(blurRadius: Dp): Color {

Expected Behavior

The tint color provided to Haze should not change implicitly or this logic could be replaced adhoc.

Actual Behavior

The color (alpha) is not as provided.

Motivation

Our theme demands completely different background colors for blur-ready and non-blur states. As we already use haze, we don't want to introduce this then if(blurAvailable) Modifier.hazeChild(...) else Modifier.background(...) style but rather decide this on the color scheme level. Currently, we overcome boosting behaviour by setting blur radius on the theme-level local providable, but this is very implicit logic.

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

No branches or pull requests

1 participant