TeamAmaze / TeamAmaze/AmazeFileManager
Remove ThemedTextView and set the text color based on background color luma
Open
Nobody has claimed this yet.
Area-UIUX
Issue-Bug
Issue-Easy (good first issue)
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
/**
* Correctly sets text color based on a given background color so that the
* user can see the text correctly
*/
@JvmStatic
fun setIntelligentTextColor(context: Context, textView: TextView, backgroundColor: Int) {
val red = Color.red(backgroundColor) * 0.299f
val green = Color.green(backgroundColor) * 0.587f
val blue = Color.blue(backgroundColor) * 0.114f
val luma = (red + green + blue) / 255.0f
val color = if(luma > 0.5) android.R.color.black else android.R.color.white
textView.setTextColor(Utils.getColor(context, color))
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the Kotlin Android sources for ThemedTextView and setIntelligentTextColor, then inspect every usage and any related color tests. The work is done when ThemedTextView is removed, text colors use the background-luma behavior described here, and the relevant Android tests or build pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100