mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.62k stars 419 forks source link

Fix default color for HtmlText and dark theme #815

Closed leinardi closed 1 year ago

leinardi commented 1 year ago

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.

mikepenz commented 1 year ago

@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 commented 1 year ago

So it should pick the right color

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

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

leinardi commented 1 year ago

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 commented 1 year ago

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