1

I have different Actionbar (Toolbar) colors in some of my activities. I get the colors from resources and there are HEX.

mToolbar.setBackground(new ColorDrawable(getResources().getColor(CharacterColors[CharID - 1])));

How i can generate a darker version of each color for status bar?

For example i want darken my Toolbar color (#34495e) to (#2a3a4b) and set it as my status bar color.

Siavash
  • 21
  • 1
  • 8
  • Possible duplicate of [Using color and color.darker in Android?](https://stackoverflow.com/questions/4928772/using-color-and-color-darker-in-android) – Peter O. Aug 13 '17 at 16:46

1 Answers1

1

You would need to write a method yourself unlike standard Java as there is a Color.darker() method.

Check this answer for a working method.

Community
  • 1
  • 1
Ahmed Hegazy
  • 12,395
  • 5
  • 41
  • 64