Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions cleverpush/src/main/java/com/cleverpush/util/ColorUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@ public static int parseColor(String colorStr) {
if (colorStr != null) {
colorStr = colorStr.trim();
}

// Convert #RGB → #RRGGBB
if (colorStr != null && colorStr.length() == 4 && colorStr.charAt(0) == '#') {
colorStr =
"#" + colorStr.charAt(1) + colorStr.charAt(1) + colorStr.charAt(2) + colorStr.charAt(2) + colorStr.charAt(3)
+ colorStr.charAt(3);
"#" + colorStr.charAt(1) + colorStr.charAt(1)
+ colorStr.charAt(2) + colorStr.charAt(2)
+ colorStr.charAt(3) + colorStr.charAt(3);
}

// Convert #RRGGBBAA → #AARRGGBB
if (colorStr != null && colorStr.length() == 9 && colorStr.charAt(0) == '#') {
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
String rrggbb = colorStr.substring(1, 7);
String aa = colorStr.substring(7, 9);
colorStr = "#" + aa + rrggbb;
}

int color = Color.BLACK;
try {
color = Color.parseColor(colorStr);
Expand Down
Loading