elect
05/13/2019, 8:50 PM// Request several formats, the first found will be used
for (request in requestFormats)
for (avail in availFormat)
if (avail.format == request && avail.colorSpace == requestColorSpace)
return avail
// If none of the requested image formats could be found, use the first available
return availFormat[0]
Luke
05/13/2019, 8:54 PMavailFormat.firstOrNull { it.format in requestFormats && it.colorSpace == requestColorSpace } ?: availFormat[0]
?elect
05/13/2019, 8:56 PMin
in my head, thanks!