From e461bbf50cdb147a6ca48942fd87babcb9f0e0fa Mon Sep 17 00:00:00 2001 From: Naveen Date: Tue, 11 Apr 2023 21:59:11 +0530 Subject: [PATCH] Disable color darkening for calendar colors --- .../calendar/pro/helpers/CalDAVHelper.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt index 9f5bb195f..bba9a7c61 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt @@ -85,9 +85,8 @@ class CalDAVHelper(val context: Context) { val accountType = cursor.getStringValue(Calendars.ACCOUNT_TYPE) val ownerName = cursor.getStringValue(Calendars.OWNER_ACCOUNT) ?: "" val color = cursor.getIntValue(Calendars.CALENDAR_COLOR) - val displayColor = getDisplayColorFromColor(color) val accessLevel = cursor.getIntValue(Calendars.CALENDAR_ACCESS_LEVEL) - val calendar = CalDAVCalendar(id, displayName, accountName, accountType, ownerName, displayColor, accessLevel) + val calendar = CalDAVCalendar(id, displayName, accountName, accountType, ownerName, color, accessLevel) calendars.add(calendar) } @@ -141,7 +140,11 @@ class CalDAVHelper(val context: Context) { context.queryCursor(uri, projection, selection, selectionArgs) { cursor -> val colorKey = cursor.getStringValue(Colors.COLOR_KEY) val color = cursor.getIntValue(Colors.COLOR) - val displayColor = getDisplayColorFromColor(color) + val displayColor = if (colorType == Colors.TYPE_CALENDAR) { + color + } else { + getDisplayColorFromColor(color) + } colors[displayColor] = colorKey } return colors.toSortedMap(HsvColorComparator())