question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accept color as int instead of resource

See original GitHub issue

Hi, I would like to set the color programatically, like this:

.header {
    this.icon = R.drawable.vector_sync
    this.color = 0xff123456.toInt()
}

However you only accept the resource. By looking at your code, you are explicitly calling getColor on buildNotification. Could you add a way for using non-resourced color?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bernaferraricommented, Jun 21, 2018

Great, thanks! It will be of great use here: https://github.com/bernaferrari/ChangeDetection

1reaction
Karncommented, Jun 21, 2018

@bernaferrari I’ve put up the PR above. Let me know if the changes are in line with your initial proposition.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get color-int from color resource? - Stack Overflow
I am trying to get the individual red, blue and green components of a color defined in the resource (R.color.myColor) so that I...
Read more >
More resource types - Android Developers
A color value defined in XML. The color is specified with an RGB value and alpha channel. You can use a color resource...
Read more >
How can I get color-int from color resource? - Stack Overflow
I am trying to get the individual red, blue and green components of a color defined in the resource (R.color.myColor) so that I...
Read more >
Colors and Styling for Visual Studio - Microsoft Learn
Learn how the Visual Studio User Experience uses color as a communication tool, instead of for purely aesthetic reasons.
Read more >
ContourPlot (cn) Resources
You can use a color index value (integer) or a named color (string). Default: Transparent (-1). cnConpackParams: This string array resource allows you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found