@@ -322,19 +322,19 @@ class AwidgetProvider : AppWidgetProvider() {
322322 // Resolve background color (0=Default, 1=System Accent, 2=Custom)
323323 fun resolveBgColor (idx : Int , isLight : Boolean ): Int {
324324 return when (idx) {
325- 0 -> if (isLight) android.graphics.Color .WHITE else android.graphics. Color .parseColor( " #212121 " )
325+ 0 -> if (isLight) android.graphics.Color .WHITE else context.getColor( R .color.widget_bg_dark )
326326 1 -> if (android.os.Build .VERSION .SDK_INT >= android.os.Build .VERSION_CODES .S ) {
327327 context.getColor(android.R .color.system_accent1_500)
328328 } else {
329- android.graphics. Color . CYAN
329+ context.getColor( R .color.widget_fallback_cyan)
330330 }
331331 2 -> {
332332 val r = prefs.getInt(" bg_color_r" , 255 )
333333 val g = prefs.getInt(" bg_color_g" , 255 )
334334 val b = prefs.getInt(" bg_color_b" , 255 )
335335 android.graphics.Color .rgb(r, g, b)
336336 }
337- else -> if (isLight) android.graphics.Color .WHITE else android.graphics. Color .parseColor( " #212121 " )
337+ else -> if (isLight) android.graphics.Color .WHITE else context.getColor( R .color.widget_bg_dark )
338338 }
339339 }
340340
@@ -355,7 +355,7 @@ class AwidgetProvider : AppWidgetProvider() {
355355 1 -> if (android.os.Build .VERSION .SDK_INT >= android.os.Build .VERSION_CODES .S ) {
356356 context.getColor(android.R .color.system_accent1_500)
357357 } else {
358- android.graphics. Color . CYAN
358+ context.getColor( R .color.widget_fallback_cyan)
359359 }
360360 2 -> {
361361 val r = prefs.getInt(" outline_color_r" , 255 )
@@ -412,17 +412,17 @@ class AwidgetProvider : AppWidgetProvider() {
412412 if (android.os.Build .VERSION .SDK_INT >= android.os.Build .VERSION_CODES .S ) {
413413 context.getColor(android.R .color.system_accent2_500)
414414 } else {
415- android.graphics. Color . YELLOW
415+ context.getColor( R .color.widget_fallback_yellow)
416416 }
417417 }
418- else -> if (useLightTheme) android.graphics. Color .parseColor( " #AA555544 " ) else android.graphics. Color .parseColor( " #BBDDDDCC " )
418+ else -> if (useLightTheme) context.getColor( R .color.widget_date_light ) else context.getColor( R .color.widget_date_dark )
419419 }
420420 }
421421 val alarmColor = if (useDynamicColors && android.os.Build .VERSION .SDK_INT >= android.os.Build .VERSION_CODES .S ) {
422422 // Cool tertiary accent for alarm
423423 context.getColor(if (useLightTheme) android.R .color.system_accent3_700 else android.R .color.system_accent3_100)
424424 } else {
425- if (useLightTheme) android.graphics. Color .parseColor( " #AA445566 " ) else android.graphics. Color .parseColor( " #BBAACCDD " )
425+ if (useLightTheme) context.getColor( R .color.widget_alarm_light ) else context.getColor( R .color.widget_alarm_dark )
426426 }
427427
428428 // Background & outline dynamic color
0 commit comments