fun runIfWallpaperCardColorsAreAvailable( run: (cardColorLight: Int, cardColorDark: Int) -> Unit, ) { if (currentWallpaper.cardColorLight != null && currentWallpaper.cardColorDark != null) { run(currentWallpaper.cardColorLight.toInt(), currentWallpaper.cardColorDark.toInt()) } } }
Run the [run] block only if the current wallpaper's card colors are available.