halilozercan / compose-richtext

A collection of Compose libraries for advanced text formatting and alternative display types.
https://halilibo.com/compose-richtext
Apache License 2.0
787 stars 65 forks source link

Can't able to change Text Color in RichText Markdown #125

Closed aiyu-ayaan closed 3 months ago

aiyu-ayaan commented 9 months ago

Recently I have been working on my project and have to use markdown for my Android project and come across your Library. The issue I faced when I turn my device in dark mode. Can you please solve this ASAP or provide me the documentation for that.

image

atulgpt commented 7 months ago

Did you try wrapping the BasicRichText in RichTextThemeProvider? Something like below?

RichTextThemeProvider(
    textStyleProvider = {
        LocalTextStyle.current.copy(
            color = colorResource(id = <your color resource id>),
        )
    },
) {
    BasicRichText {
        Markdown(
            content = <markdown content>
        )
    }
}