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

Fix default color for HtmlText and dark theme #815

Merged
merged 1 commit into from Nov 23, 2022

Conversation

leinardi
Copy link
Contributor

@leinardi leinardi commented Nov 23, 2022

This PR fixes an issue I found when using HtmlText together with a Dark theme:

image

Instead of hard-coding the default color of this Composable to Color.Black, it now uses the LibraryDefaults.libraryColors().contentColor, that properly support Light and Dark themes.

@leinardi leinardi marked this pull request as ready for review November 23, 2022 16:34
@mikepenz
Copy link
Owner

@leinardi can you reproduce this in the sample app?

Interesting enough the color is already passed via the LibraryDefaults here: https://github.com/mikepenz/AboutLibraries/blob/a34b18d0996b9aff1dbe2d8489869a5535fee8bb/aboutlibraries-compose/src/androidMain/kotlin/com/mikepenz/aboutlibraries/ui/compose/Libraries.kt#LL150C48-L150C48

So it should pick the right color 🤔

@leinardi
Copy link
Contributor Author

leinardi commented Nov 23, 2022

So it should pick the right color

Yep, but in mine implementation I'm calling HtmlText directly since I show a custom AlertDialog 😉

This change it's only needed for users that call HtmlText directly, like I do.

@leinardi
Copy link
Contributor Author

leinardi commented Nov 23, 2022

If you don't like this change, could you please remove the default argument from the HtmlText? This way who calls it will be forced to provide a color, instead of falling back to Color.Black.

@mikepenz
Copy link
Owner

Thanks for the explanation. Makes a lot of sense :)

@mikepenz mikepenz added the fix label Nov 23, 2022
@mikepenz mikepenz changed the title fix issue with HtmlText and dark theme Fix default color for HtmlText and dark theme Nov 23, 2022
@mikepenz mikepenz merged commit 19277f6 into mikepenz:develop Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants