Understanding colors on Android (six characters)
If you provide 6 hex digits, that means RGB (2 hex digits for each value of red, green and blue).
If you provide 8 hex digits, it's an ARGB (2 hex digits for each value of alpha, red, green and blue respectively).
So by removing the final 55 you're changing from A=B4, R=55, G=55, B=55 (a mostly transparent grey), to R=B4, G=55, B=55 (a fully-non-transparent dusky pinky).
See the "Color" documentation for the supported formats.
Hex transparency in colors
Here's a correct table of percentages to hex values for opacity. E.g. for 50% white you'd use #80FFFFFF. To think in terms of transparency instead, flip the order of the percentages (more opaque = less transparent).
% | Hex |
---|---|
100% | FF |
95% | F2 |
90% | E6 |
85% | D9 |
80% | CC |
75% | BF |
70% | B3 |
65% | A6 |
60% | 99 |
55% | 8C |
50% | 80 |
45% | 73 |
40% | 66 |
35% | 59 |
30% | 4D |
25% | 40 |
20% | 33 |
15% | 26 |
10% | 1A |
5% | 0D |
0% | 00 |
How to get a Color from hexadecimal Color String
Try Color
class method:
public static int parseColor (String colorString)
From Android documentation:
Supported formats are: #RRGGBB #AARRGGBB 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', 'lightgray', 'darkgray'
AndroidX: String.toColorInt()
What are the Material Design dark theme colors?
This is the latest version of colors:
This page in the official material design website is dedicated to dark theme (including its colors). Here is the colors:
The image below compares Light and Dark theme colors (Light colors on the left side, Dark colors on the right):
Image credits: official material design website
Android Q dark mode changes color of drawable form white to gray
Try calling setForceDarkAllowed(false) on the views you want to remain the same when dark mode is enabled.
See the docs
Related Topics
How to Change Spinner Text Size and Text Color
Show Image View from File Path
How to Detect When an Android Application Is Running in the Emulator
How to Add a Jar in External Libraries in Android Studio
Running Google Maps V2 on the Android Emulator
How to Install Google Frameworks (Play, Accounts, etc.) on a Genymotion Virtual Device
How to Record a Video in My Android App
Android Pick Images from Gallery
Onitemclicklistener Not Working in Listview
How to Programmatically Add Views to Views
Eclipse Giving Error, Missing R.Java File After Recent Update
You Have Not Accepted the License Agreements of the Following Sdk Components
How to Use Speech Recognition Without the Annoying Dialog in Android Phones
How to Dynamically Load a Library at Runtime from an Android Application