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

Random color doesn't work #71

Open
unusualdri opened this issue Nov 2, 2018 · 1 comment
Open

Random color doesn't work #71

unusualdri opened this issue Nov 2, 2018 · 1 comment

Comments

@unusualdri
Copy link

Hi,
This is the code I have
private val textBuilder = TextDrawable.builder()
private val colorGenerator = ColorGenerator.MATERIAL;

fun String.toTextDrawable() : TextDrawable {
    return textBuilder.buildRound(
            this[0].toString(),
            colorGenerator.randomColor
    )
}

The generated drawable has aways a gray background.

@buildbro
Copy link

buildbro commented Jul 2, 2019

I faced something similar today and wasted 30 minutes looking in the wrong place. Turns out I was using :tint in my XML to color the imageview gray. Remove that property fixed the issue for me.

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

2 participants